mirror of
https://github.com/zumbiepig/MineXLauncher.git
synced 2025-06-08 09:24:48 +00:00
add toggle function
This commit is contained in:
parent
b3456053ff
commit
524b27926d
@ -287,6 +287,18 @@ const mods = {
|
||||
storage.local.set('mods', mods);
|
||||
}
|
||||
},
|
||||
toggle: function (mod: string): void {
|
||||
const mods: string[] = storage.local.get('mods') ?? [];
|
||||
const modIndex = mods.indexOf(mod);
|
||||
if (modIndex === -1) {
|
||||
mods.push(mod);
|
||||
mods.sort();
|
||||
storage.local.set('mods', mods);
|
||||
} else {
|
||||
mods.splice(modIndex, 1);
|
||||
storage.local.set('mods', mods);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const serviceworker = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user