reaction settings auto reload
This commit is contained in:
parent
bcaaa19c43
commit
c6f0047aed
|
@ -39,8 +39,9 @@ app.proxy = true;
|
|||
|
||||
// Replace trailing slashes
|
||||
app.use(async (ctx, next) => {
|
||||
if (ctx.request.path !== "/" && ctx.request.path.endsWith('/')) return ctx.redirect(ctx.request.path.replace(/\/$/, ""))
|
||||
else await next()
|
||||
if (ctx.request.path !== "/" && ctx.request.path.endsWith("/"))
|
||||
return ctx.redirect(ctx.request.path.replace(/\/$/, ""));
|
||||
else await next();
|
||||
});
|
||||
|
||||
if (!["production", "test"].includes(process.env.NODE_ENV || "")) {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
<div class="_formRoot">
|
||||
<FormSwitch v-model="enableEmojiReactions" class="_formBlock">
|
||||
{{ i18n.ts.enableEmojiReactions }}
|
||||
<template #caption>{{ i18n.ts.needReloadToApply }}</template>
|
||||
</FormSwitch>
|
||||
|
||||
<div v-if="enableEmojiReactions">
|
||||
|
@ -104,6 +103,17 @@ import { defaultStore } from "@/store";
|
|||
import { i18n } from "@/i18n";
|
||||
import { definePageMetadata } from "@/scripts/page-metadata";
|
||||
import { deepClone } from "@/scripts/clone";
|
||||
import { unisonReload } from "@/scripts/unison-reload";
|
||||
|
||||
async function reloadAsk() {
|
||||
const { canceled } = await os.confirm({
|
||||
type: "info",
|
||||
text: i18n.ts.reloadToApplySetting,
|
||||
});
|
||||
if (canceled) return;
|
||||
|
||||
unisonReload();
|
||||
}
|
||||
|
||||
let reactions = $ref(deepClone(defaultStore.state.reactions));
|
||||
|
||||
|
@ -185,6 +195,10 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
watch(enableEmojiReactions, async () => {
|
||||
await reloadAsk();
|
||||
});
|
||||
|
||||
const headerActions = $computed(() => []);
|
||||
|
||||
const headerTabs = $computed(() => []);
|
||||
|
|
Loading…
Reference in New Issue