Add back the default known groups.
This commit is contained in:
parent
009ff2e424
commit
35f1bf35ca
|
@ -1,6 +1,7 @@
|
||||||
import {createValue} from "@holllo/webextension-storage";
|
import {createValue} from "@holllo/webextension-storage";
|
||||||
import browser from "webextension-polyfill";
|
import browser from "webextension-polyfill";
|
||||||
import {Data, Feature} from "./enums.js";
|
import {Data, Feature} from "./enums.js";
|
||||||
|
import {defaultKnownGroups} from "./known-groups.js";
|
||||||
import {collectUsernameColors} from "./username-color.js";
|
import {collectUsernameColors} from "./username-color.js";
|
||||||
import {collectUserLabels} from "./user-label.js";
|
import {collectUserLabels} from "./user-label.js";
|
||||||
|
|
||||||
|
@ -38,7 +39,7 @@ export const storageValues = {
|
||||||
deserialize: (input) => new Set(JSON.parse(input) as string[]),
|
deserialize: (input) => new Set(JSON.parse(input) as string[]),
|
||||||
serialize: (input) => JSON.stringify(Array.from(input)),
|
serialize: (input) => JSON.stringify(Array.from(input)),
|
||||||
key: Data.KnownGroups,
|
key: Data.KnownGroups,
|
||||||
value: new Set([]),
|
value: new Set(defaultKnownGroups),
|
||||||
storage: browser.storage.sync,
|
storage: browser.storage.sync,
|
||||||
}),
|
}),
|
||||||
[Data.LatestActiveFeatureTab]: createValue({
|
[Data.LatestActiveFeatureTab]: createValue({
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
/**
|
||||||
|
* A list of default known groups to seed the Autocomplete feature with.
|
||||||
|
*
|
||||||
|
* This list does not need to be updated to match the groups available on Tildes.
|
||||||
|
* Instead, in `source/utilities/groups.ts` is a function that will extract the
|
||||||
|
* groups from Tildes whenever the user goes to `https://tildes.net/groups`.
|
||||||
|
*
|
||||||
|
* Inside `source/content-scripts/setup.tsx` a list of features that uses this
|
||||||
|
* data is defined, when any of those features are enabled the extract function
|
||||||
|
* will be called. So if a feature ever gets added that uses this data, remember
|
||||||
|
* to add it to the list in the content scripts setup.
|
||||||
|
*/
|
||||||
|
export const defaultKnownGroups = [
|
||||||
|
"~anime",
|
||||||
|
"~arts",
|
||||||
|
"~books",
|
||||||
|
"~comp",
|
||||||
|
"~creative",
|
||||||
|
"~design",
|
||||||
|
"~enviro",
|
||||||
|
"~finance",
|
||||||
|
"~food",
|
||||||
|
"~games",
|
||||||
|
"~games.game_design",
|
||||||
|
"~games.tabletop",
|
||||||
|
"~health",
|
||||||
|
"~hobbies",
|
||||||
|
"~humanities",
|
||||||
|
"~lgbt",
|
||||||
|
"~life",
|
||||||
|
"~misc",
|
||||||
|
"~movies",
|
||||||
|
"~music",
|
||||||
|
"~news",
|
||||||
|
"~science",
|
||||||
|
"~space",
|
||||||
|
"~sports",
|
||||||
|
"~talk",
|
||||||
|
"~tech",
|
||||||
|
"~test",
|
||||||
|
"~tildes",
|
||||||
|
"~tildes.official",
|
||||||
|
"~tv",
|
||||||
|
];
|
Loading…
Reference in New Issue