mirror of
https://github.com/Equicord/Equicord.git
synced 2025-03-14 14:10:26 -04:00
Update StatusWhilePlaying
This commit is contained in:
parent
ab952b83c1
commit
ca9bd5ac14
2 changed files with 4 additions and 4 deletions
|
@ -5,13 +5,13 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { definePluginSettings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
|
import { getUserSettingLazy } from "@api/UserSettings";
|
||||||
import { EquicordDevs } from "@utils/constants";
|
import { EquicordDevs } from "@utils/constants";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { findByCodeLazy } from "@webpack";
|
|
||||||
import { PresenceStore, UserStore } from "@webpack/common";
|
import { PresenceStore, UserStore } from "@webpack/common";
|
||||||
|
|
||||||
let savedStatus = "";
|
let savedStatus = "";
|
||||||
const updateAsync = findByCodeLazy("updateAsync", "status");
|
const statusSettings = getUserSettingLazy("status", "status");
|
||||||
const settings = definePluginSettings({
|
const settings = definePluginSettings({
|
||||||
statusToSet: {
|
statusToSet: {
|
||||||
type: OptionType.SELECT,
|
type: OptionType.SELECT,
|
||||||
|
@ -49,11 +49,11 @@ export default definePlugin({
|
||||||
if (event.games.length > 0) {
|
if (event.games.length > 0) {
|
||||||
if (status !== settings.store.statusToSet) {
|
if (status !== settings.store.statusToSet) {
|
||||||
savedStatus = status;
|
savedStatus = status;
|
||||||
updateAsync(settings.store.statusToSet);
|
statusSettings?.updateSetting(settings.store.statusToSet);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (savedStatus !== "" && savedStatus !== settings.store.statusToSet)
|
if (savedStatus !== "" && savedStatus !== settings.store.statusToSet)
|
||||||
updateAsync(savedStatus);
|
statusSettings?.updateSetting(savedStatus);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue