wrap LogWatcher

This commit is contained in:
pypy
2020-11-07 21:49:22 +09:00
parent e90db57169
commit 94f6cc0f03
2 changed files with 42 additions and 24 deletions
+9 -10
View File
@@ -14,14 +14,15 @@ import locale from 'element-ui/lib/locale/lang/en';
import sharedRepository from './repository/shared.js';
import configRepository from './repository/config.js';
import webApiService from './service/webapi.js';
import logWatcherService from './service/logwatcher.js'
(async function () {
await CefSharp.BindObjectAsync(
'WebApi',
'VRCX',
'SharedVariable', // DO NOT DIRECT ACCESS
'SharedVariable',
'VRCXStorage',
'SQLite', // DO NOT DIRECT ACCESS
'SQLite',
'LogWatcher',
'Discord'
);
@@ -3294,8 +3295,9 @@ import webApiService from './service/webapi.js';
methods: {},
watch: {},
el: '#x-app',
mounted() {
LogWatcher.Reset().then(() => {
async mounted() {
this.checkAppVersion();
await logWatcherService.reset();
API.$on('SHOW_WORLD_DIALOG', (tag) => this.showWorldDialog(tag));
API.$on('SHOW_LAUNCH_DIALOG', (tag) => this.showLaunchDialog(tag));
this.updateLoop();
@@ -3313,8 +3315,6 @@ import webApiService from './service/webapi.js';
return args;
});
});
});
this.checkAppVersion();
}
};
@@ -4483,10 +4483,9 @@ import webApiService from './service/webapi.js';
}
};
$app.methods.resetGameLog = function () {
LogWatcher.Reset().then(() => {
$app.methods.resetGameLog = async function () {
await logWatcherService.reset();
this.gameLogTable.data = [];
});
};
$app.methods.updateGameLogLoop = async function () {
@@ -4513,7 +4512,7 @@ import webApiService from './service/webapi.js';
username: currentUserName
} = API.currentUser;
for (var [fileName, dt, type, ...args] of await LogWatcher.Get()) {
for (var [fileName, dt, type, ...args] of await logWatcherService.get()) {
var gameLogContext = gameLogContextMap.get(fileName);
if (gameLogContext === undefined) {
gameLogContext = {
+19
View File
@@ -0,0 +1,19 @@
// requires binding of LogWatcher
class LogWatcherService {
get() {
return LogWatcher.Get();
}
reset() {
return LogWatcher.Reset();
}
}
var self = new LogWatcherService();
window.logWatcherService = self;
export {
self as default,
LogWatcherService
};