Update extatic events

This commit is contained in:
ZXY101
2024-03-10 03:06:46 +02:00
parent e511a0a39b
commit 5bc486660c
2 changed files with 11 additions and 5 deletions

View File

@@ -207,8 +207,10 @@
fireExstaticEvent('mokuro-reader:page.change', { fireExstaticEvent('mokuro-reader:page.change', {
title: volume.mokuroData.title, title: volume.mokuroData.title,
volumeName: volume.mokuroData.volume, volumeName: volume.mokuroData.volume,
currentCharCount: charCount || 0, currentCharCount: getCharCount(pages, page) || 0,
currentPageNum: page currentPage: page,
totalPages: pages.length,
totalCharCount: maxCharCount || 0
}); });
} }
} }
@@ -218,8 +220,10 @@
fireExstaticEvent('mokuro-reader:reader.closed', { fireExstaticEvent('mokuro-reader:reader.closed', {
title: volume.mokuroData.title, title: volume.mokuroData.title,
volumeName: volume.mokuroData.volume, volumeName: volume.mokuroData.volume,
currentCharCount: charCount || 0, currentCharCount: getCharCount(pages, page) || 0,
currentPageNum: page currentPage: page,
totalPages: pages.length,
totalCharCount: maxCharCount || 0
}); });
} }
}); });

View File

@@ -37,7 +37,9 @@ type ExtaticPayload = {
title: string; title: string;
volumeName: string; volumeName: string;
currentCharCount: number; currentCharCount: number;
currentPageNum: number; totalCharCount: number;
currentPage: number;
totalPages: number
} }
type ExtaticEvent = 'mokuro-reader:page.change' | 'mokuro-reader:reader.closed' type ExtaticEvent = 'mokuro-reader:page.change' | 'mokuro-reader:reader.closed'