CallTimer: Fix Devs

This commit is contained in:
thororen1234 2025-12-28 21:09:50 -05:00
parent c45e60134e
commit 43d68add4c
No known key found for this signature in database
4 changed files with 9 additions and 14 deletions

View file

@ -278,7 +278,7 @@ export function migratePluginSetting(pluginName: string, newSetting: string, old
SettingsStore.markAsChanged();
}
export function migratePluginToSettings(newName: string, oldName: string, ...settingNames: string[]) {
export function migratePluginToSettings(deleteOldSettings: boolean, newName: string, oldName: string, ...settingNames: string[]) {
const { plugins } = SettingsStore.plain;
const newPlugin = plugins[newName];
const oldPlugin = plugins[oldName];
@ -290,12 +290,12 @@ export function migratePluginToSettings(newName: string, oldName: string, ...set
}
newPlugin.enabled = true;
delete plugins[oldName];
if (deleteOldSettings) delete plugins[oldName];
SettingsStore.markAsChanged();
}
}
export function migrateSettingsFromPlugin(newPlugin: string, oldPlugin: string, migratePlugin: boolean, migrationName: string, ...settings: string[]) {
export function migrateSettingsFromPlugin(newPlugin: string, oldPlugin: string, ...settings: string[]) {
const { plugins } = SettingsStore.plain;
const oldSettings = plugins[oldPlugin];
@ -312,12 +312,6 @@ export function migrateSettingsFromPlugin(newPlugin: string, oldPlugin: string,
delete oldSettings[setting];
}
if (migratePlugin) {
newSettings[migrationName] = oldSettings.enabled;
newSettings.enabled = true;
delete plugins[oldPlugin];
}
SettingsStore.markAsChanged();
}

View file

@ -1099,7 +1099,7 @@ function getQuestAcceptedButtonProps(quest: Quest, text: string, disabled: boole
}
// Drop support for QuestCompleter and migrate to Questify settings.
migratePluginToSettings("Questify", "QuestCompleter", "completeVideoQuestsInBackground", "completeGameQuestsInBackground", "completeAchievementQuestsInBackground");
migratePluginToSettings(true, "Questify", "QuestCompleter", "completeVideoQuestsInBackground", "completeGameQuestsInBackground", "completeAchievementQuestsInBackground");
export default definePlugin({
name: "Questify",

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { definePluginSettings, migrateSettingsFromPlugin } from "@api/Settings";
import { definePluginSettings, migratePluginToSettings, migrateSettingsFromPlugin } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs, EquicordDevs } from "@utils/constants";
import { useTimer } from "@utils/react";
@ -106,11 +106,12 @@ let myLastChannelId: string | undefined;
// Allow user updates on discord first load
let runOneTime = true;
migrateSettingsFromPlugin("CallTimer", "AllCallTimers", true, "allCallTimers", "showWithoutHover", "showRoleColor", "trackSelf", "showSeconds", "watchLargeGuilds");
migratePluginToSettings(false, "CallTimer", "AllCallTimers", "allCallTimers");
migrateSettingsFromPlugin("CallTimer", "AllCallTimers", "showWithoutHover", "showRoleColor", "trackSelf", "showSeconds", "watchLargeGuilds");
export default definePlugin({
name: "CallTimer",
description: "Add call timers for all users in voice channels and in the connection status.",
authors: [EquicordDevs.MaxHerbold, Devs.D3SOX],
authors: [Devs.Ven, EquicordDevs.MaxHerbold, Devs.D3SOX],
managedStyle: alignedChatInputFix,
settings,

View file

@ -110,7 +110,7 @@ const TypingUser = ErrorBoundary.wrap(function TypingUser({ user, guildId }: Typ
);
}, { noop: true });
migratePluginToSettings("TypingTweaks", "AmITyping", "amITyping");
migratePluginToSettings(true, "TypingTweaks", "AmITyping", "amITyping");
export default definePlugin({
name: "TypingTweaks",
description: "Show avatars and role colours in the typing indicator",