reaction settings auto reload

This commit is contained in:
ThatOneCalculator 2023-04-19 20:46:37 -07:00
parent bcaaa19c43
commit c6f0047aed
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
2 changed files with 19 additions and 4 deletions

View File

@ -37,10 +37,11 @@ export const serverLogger = new Logger("server", "gray", false);
const app = new Koa();
app.proxy = true;
// Replace trailing slashes
// 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 || "")) {

View File

@ -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(() => []);