mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-05 03:05:52 +02:00
refactor
This commit is contained in:
@@ -52,7 +52,7 @@ export async function lookupUserByEmail() {
|
||||
const user = await os.apiWithDialog('admin/accounts/find-by-email', { email: result });
|
||||
|
||||
os.pageWindow(`/admin/user/${user.id}`);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
if (err.code === 'USER_NOT_FOUND') {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
|
||||
@@ -10,7 +10,7 @@ export const chartLegend = (legend: InstanceType<typeof MkChartLegend>) => ({
|
||||
id: 'htmlLegend',
|
||||
afterUpdate(chart, args, options) {
|
||||
// Reuse the built-in legendItems generator
|
||||
const items = chart.options.plugins.legend.labels.generateLabels(chart);
|
||||
const items = chart.options.plugins!.legend!.labels!.generateLabels!(chart);
|
||||
|
||||
legend.update(chart, items);
|
||||
},
|
||||
|
||||
@@ -27,7 +27,7 @@ export async function load() {
|
||||
scope: ['clickerGame'],
|
||||
key: 'saveData',
|
||||
});
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
if (err.code === 'NO_SUCH_KEY') {
|
||||
saveData.value = {
|
||||
gameVersion: 2,
|
||||
@@ -43,20 +43,6 @@ export async function load() {
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
|
||||
// migration
|
||||
if (saveData.value.gameVersion === 1) {
|
||||
saveData.value = {
|
||||
gameVersion: 2,
|
||||
cookies: saveData.value.cookies,
|
||||
totalCookies: saveData.value.cookies,
|
||||
totalHandmadeCookies: saveData.value.cookies,
|
||||
clicked: saveData.value.clicked,
|
||||
achievements: [],
|
||||
facilities: [],
|
||||
};
|
||||
save();
|
||||
}
|
||||
}
|
||||
|
||||
export async function save() {
|
||||
|
||||
@@ -39,7 +39,7 @@ export async function getNoteClipMenu(props: {
|
||||
}
|
||||
}
|
||||
|
||||
const appearNote = getAppearNote(props.note);
|
||||
const appearNote = getAppearNote(props.note) ?? props.note;
|
||||
|
||||
const clips = await clipsCache.fetch();
|
||||
const menu: MenuItem[] = [...clips.map(clip => ({
|
||||
|
||||
Reference in New Issue
Block a user