mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-09 16:40:10 +01:00
Fix stats init error
This commit is contained in:
parent
f285110773
commit
4ecf2b9f2d
@ -1,5 +1,5 @@
|
|||||||
import { humanizedDateTime, favsToHotswap, getMessageTimeStamp, dragElement, isMobile, initRossMods, } from "./scripts/RossAscends-mods.js";
|
import { humanizedDateTime, favsToHotswap, getMessageTimeStamp, dragElement, isMobile, initRossMods, } from "./scripts/RossAscends-mods.js";
|
||||||
import { userStatsHandler, statMesProcess } from './scripts/stats.js';
|
import { userStatsHandler, statMesProcess, initStats } from './scripts/stats.js';
|
||||||
import {
|
import {
|
||||||
generateKoboldWithStreaming,
|
generateKoboldWithStreaming,
|
||||||
kai_settings,
|
kai_settings,
|
||||||
@ -723,6 +723,7 @@ async function firstLoadInit() {
|
|||||||
initAuthorsNote();
|
initAuthorsNote();
|
||||||
initPersonas();
|
initPersonas();
|
||||||
initRossMods();
|
initRossMods();
|
||||||
|
initStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkOnlineStatus() {
|
function checkOnlineStatus() {
|
||||||
|
@ -330,8 +330,7 @@ async function statMesProcess(line, type, characters, this_chid, oldMesssage) {
|
|||||||
updateStats();
|
updateStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery(() => {
|
export function initStats() {
|
||||||
function init() {
|
|
||||||
$(".rm_stats_button").on('click', function () {
|
$(".rm_stats_button").on('click', function () {
|
||||||
characterStatsHandler(characters, this_chid);
|
characterStatsHandler(characters, this_chid);
|
||||||
});
|
});
|
||||||
@ -339,14 +338,4 @@ jQuery(() => {
|
|||||||
registerDebugFunction('refreshStats', 'Refresh Stat File', 'Recreates the stats file based on existing chat files', recreateStats);
|
registerDebugFunction('refreshStats', 'Refresh Stat File', 'Recreates the stats file based on existing chat files', recreateStats);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check every 100ms if registerDebugFunction is defined (this is bad lmao)
|
|
||||||
const interval = setInterval(() => {
|
|
||||||
if (typeof registerDebugFunction !== 'undefined') {
|
|
||||||
clearInterval(interval); // Clear the interval once the function is found
|
|
||||||
init(); // Initialize your code
|
|
||||||
}
|
|
||||||
}, 100);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
export { userStatsHandler, characterStatsHandler, getStats, statMesProcess, charStats };
|
export { userStatsHandler, characterStatsHandler, getStats, statMesProcess, charStats };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user