wip
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import VueI18n from 'vue-i18n';
|
||||
import { I18n } from 'vue-i18n';
|
||||
import { clientDb, clear, bulkSet } from '../db';
|
||||
import { deepEntries, delimitEntry } from 'deep-entries';
|
||||
|
||||
export function setI18nContexts(lang: string, version: string, i18n: VueI18n, cleardb = false) {
|
||||
export function setI18nContexts(lang: string, version: string, i18n: I18n, cleardb = false) {
|
||||
return Promise.all([
|
||||
cleardb ? clear(clientDb.i18n) : Promise.resolve(),
|
||||
fetch(`/assets/locales/${lang}.${version}.json`)
|
||||
|
@@ -2,7 +2,6 @@ import autobind from 'autobind-decorator';
|
||||
import { EventEmitter } from 'eventemitter3';
|
||||
import ReconnectingWebsocket from 'reconnecting-websocket';
|
||||
import { wsUrl } from '../config';
|
||||
import MiOS from '../mios';
|
||||
|
||||
/**
|
||||
* Misskey stream connection
|
||||
@@ -14,13 +13,11 @@ export default class Stream extends EventEmitter {
|
||||
private sharedConnections: SharedConnection[] = [];
|
||||
private nonSharedConnections: NonSharedConnection[] = [];
|
||||
|
||||
constructor(os: MiOS) {
|
||||
constructor(user) {
|
||||
super();
|
||||
|
||||
this.state = 'initializing';
|
||||
|
||||
const user = os.store.state.i;
|
||||
|
||||
this.stream = new ReconnectingWebsocket(wsUrl + (user ? `?i=${user.token}` : ''), '', { minReconnectionDelay: 1 }); // https://github.com/pladaria/reconnecting-websocket/issues/91
|
||||
this.stream.addEventListener('open', this.onOpen);
|
||||
this.stream.addEventListener('close', this.onClose);
|
||||
|
Reference in New Issue
Block a user