Skip to content

Commit

Permalink
Возврат опредения языка в инициализацию, потому что не успевает срабо…
Browse files Browse the repository at this point in the history
…тать videoObserver
  • Loading branch information
SashaXser authored Jan 29, 2024
1 parent 1e67777 commit 81bc559
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/vot-cloudflare-min.user.js

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion dist/vot-cloudflare.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4199,6 +4199,8 @@ class VideoHandler {
proxyWorkerHost: await storage/* votStorage */.i.get("proxyWorkerHost", config/* proxyWorkerHost */.ez),
};

this.videoData = await this.getVideoData();

console.log("[db] data from db: ", this.data);

this.subtitlesWidget = new SubtitlesWidget(
Expand All @@ -4217,6 +4219,12 @@ class VideoHandler {
this.votButton.container.hidden = hide;
hide && (this.votMenu.container.hidden = hide);

await this.updateSubtitles();
await this.changeSubtitlesLang("disabled");
this.setSelectMenuValues(
this.videoData.detectedLanguage,
this.data.responseLanguage ?? "ru",
);
this.translateToLang = this.data.responseLanguage ?? "ru";

this.initExtraEvents();
Expand Down Expand Up @@ -5981,7 +5989,6 @@ class VideoHandler {
this.stopTranslation();
this.releaseExtraEvents();
this.subtitlesWidget.release();
clearInterval(this.srcObjectInterval);
this.votButton.container.remove();
this.votMenu.container.remove();
}
Expand Down
2 changes: 1 addition & 1 deletion dist/vot-min.user.js

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion dist/vot.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4188,6 +4188,8 @@ class VideoHandler {
proxyWorkerHost: await storage/* votStorage */.i.get("proxyWorkerHost", config/* proxyWorkerHost */.ez),
};

this.videoData = await this.getVideoData();

console.log("[db] data from db: ", this.data);

this.subtitlesWidget = new SubtitlesWidget(
Expand All @@ -4206,6 +4208,12 @@ class VideoHandler {
this.votButton.container.hidden = hide;
hide && (this.votMenu.container.hidden = hide);

await this.updateSubtitles();
await this.changeSubtitlesLang("disabled");
this.setSelectMenuValues(
this.videoData.detectedLanguage,
this.data.responseLanguage ?? "ru",
);
this.translateToLang = this.data.responseLanguage ?? "ru";

this.initExtraEvents();
Expand Down Expand Up @@ -5960,7 +5968,6 @@ class VideoHandler {
this.stopTranslation();
this.releaseExtraEvents();
this.subtitlesWidget.release();
clearInterval(this.srcObjectInterval);
this.votButton.container.remove();
this.votMenu.container.remove();
}
Expand Down
9 changes: 8 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ class VideoHandler {
proxyWorkerHost: await votStorage.get("proxyWorkerHost", proxyWorkerHost),
};

this.videoData = await this.getVideoData();

console.log("[db] data from db: ", this.data);

this.subtitlesWidget = new SubtitlesWidget(
Expand All @@ -320,6 +322,12 @@ class VideoHandler {
this.votButton.container.hidden = hide;
hide && (this.votMenu.container.hidden = hide);

await this.updateSubtitles();
await this.changeSubtitlesLang("disabled");
this.setSelectMenuValues(
this.videoData.detectedLanguage,
this.data.responseLanguage ?? "ru",
);
this.translateToLang = this.data.responseLanguage ?? "ru";

this.initExtraEvents();
Expand Down Expand Up @@ -2084,7 +2092,6 @@ class VideoHandler {
this.stopTranslation();
this.releaseExtraEvents();
this.subtitlesWidget.release();
clearInterval(this.srcObjectInterval);
this.votButton.container.remove();
this.votMenu.container.remove();
}
Expand Down

0 comments on commit 81bc559

Please sign in to comment.