mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-25 15:46:06 +09:00
reaction settings auto reload
This commit is contained in:
parent
2330be77dd
commit
45b3e5635d
@ -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 || "")) {
|
||||
|
@ -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
Block a user