feat(page-editor.el.note): make it retry on throttle

This commit is contained in:
Outvi V 2025-06-03 00:27:53 +08:00
parent fc47460ae2
commit b83123003e

View file

@ -25,6 +25,7 @@ SPDX-License-Identifier: AGPL-3.0-only
/* eslint-disable vue/no-mutating-props */ /* eslint-disable vue/no-mutating-props */
import { watch, ref } from 'vue'; import { watch, ref } from 'vue';
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import { retryOnThrottled } from '@@/js/retry-on-throttled.js';
import XContainer from '../page-editor.container.vue'; import XContainer from '../page-editor.container.vue';
import MkInput from '@/components/MkInput.vue'; import MkInput from '@/components/MkInput.vue';
import MkSwitch from '@/components/MkSwitch.vue'; import MkSwitch from '@/components/MkSwitch.vue';
@ -58,7 +59,7 @@ watch(id, async () => {
...props.modelValue, ...props.modelValue,
note: id.value, note: id.value,
}); });
note.value = await misskeyApi('notes/show', { noteId: id.value }); note.value = await retryOnThrottled(() => misskeyApi('notes/show', { noteId: id.value }));
}, { }, {
immediate: true, immediate: true,
}); });