Only show mfm warning the first time + fix sparkle
This commit is contained in:
parent
f0fe5fcf6c
commit
d2f1f6f4c0
|
@ -187,11 +187,15 @@ let disableMfm = $ref(hasMfm && defaultStore.state.animatedMfm);
|
||||||
|
|
||||||
async function toggleMfm() {
|
async function toggleMfm() {
|
||||||
if (disableMfm) {
|
if (disableMfm) {
|
||||||
const { canceled } = await os.confirm({
|
if (!defaultStore.state.animatedMfmWarnShown) {
|
||||||
type: "warning",
|
const { canceled } = await os.confirm({
|
||||||
text: i18n.ts._mfm.warn,
|
type: "warning",
|
||||||
});
|
text: i18n.ts._mfm.warn,
|
||||||
if (canceled) return;
|
});
|
||||||
|
if (canceled) return;
|
||||||
|
|
||||||
|
defaultStore.set("animatedMfmWarnShown", true);
|
||||||
|
}
|
||||||
|
|
||||||
disableMfm = false;
|
disableMfm = false;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -151,7 +151,7 @@ export default defineComponent({
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "sparkle": {
|
case "sparkle": {
|
||||||
if (!(defaultStore.state.animatedMfm || reducedMotion())) {
|
if (reducedMotion()) {
|
||||||
return genEl(token.children);
|
return genEl(token.children);
|
||||||
}
|
}
|
||||||
return h(MkSparkle, {}, genEl(token.children));
|
return h(MkSparkle, {}, genEl(token.children));
|
||||||
|
|
|
@ -158,6 +158,10 @@ export const defaultStore = markRaw(
|
||||||
where: "device",
|
where: "device",
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
animatedMfmWarnShown: {
|
||||||
|
where: "device",
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
loadRawImages: {
|
loadRawImages: {
|
||||||
where: "device",
|
where: "device",
|
||||||
default: false,
|
default: false,
|
||||||
|
|
Loading…
Reference in New Issue