mirror of
https://codeberg.org/librewolf/source.git
synced 2025-03-11 21:52:17 -05:00
Fix fullpage-translations.patch
This commit is contained in:
parent
a13efa934b
commit
7af080e8d1
1 changed files with 14 additions and 14 deletions
|
@ -1,22 +1,22 @@
|
||||||
--- a/services/settings/Attachments.sys.mjs
|
--- a/services/settings/Attachments.sys.mjs
|
||||||
+++ b/services/settings/Attachments.sys.mjs
|
+++ b/services/settings/Attachments.sys.mjs
|
||||||
@@ -133,6 +133,7 @@ export class Downloader {
|
@@ -144,6 +144,7 @@ export class Downloader {
|
||||||
* @param {Boolean} options.fallbackToDump Use the remote settings dump as a
|
* @param {Boolean} [options.fallbackToDump] Use the remote settings dump as a
|
||||||
* potential source of the attachment.
|
* potential source of the attachment.
|
||||||
* (default: `false`)
|
* (default: `false`)
|
||||||
+ * @param {string} options.serverUrl
|
+ * @param {string} options.serverUrl
|
||||||
* @throws {Downloader.DownloadError} if the file could not be fetched.
|
* @throws {Downloader.DownloadError} if the file could not be fetched.
|
||||||
* @throws {Downloader.BadContentError} if the downloaded content integrity is not valid.
|
* @throws {Downloader.BadContentError} if the downloaded content integrity is not valid.
|
||||||
* @throws {Downloader.ServerInfoError} if the server response is not valid.
|
* @throws {Downloader.ServerInfoError} if the server response is not valid.
|
||||||
@@ -149,6 +150,7 @@ export class Downloader {
|
@@ -203,6 +204,7 @@ export class Downloader {
|
||||||
attachmentId = record?.id,
|
|
||||||
fallbackToCache = false,
|
fallbackToCache = false,
|
||||||
fallbackToDump = false,
|
fallbackToDump = false,
|
||||||
|
avoidDownload = false,
|
||||||
+ serverUrl,
|
+ serverUrl,
|
||||||
} = options || {};
|
} = options || {};
|
||||||
if (!attachmentId) {
|
if (!attachmentId) {
|
||||||
// Check for pre-condition. This should not happen, but it is explicitly
|
// Check for pre-condition. This should not happen, but it is explicitly
|
||||||
@@ -200,6 +202,7 @@ export class Downloader {
|
@@ -254,6 +256,7 @@ export class Downloader {
|
||||||
const newBuffer = await this.downloadAsBytes(record, {
|
const newBuffer = await this.downloadAsBytes(record, {
|
||||||
retries,
|
retries,
|
||||||
checkHash,
|
checkHash,
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
});
|
});
|
||||||
const blob = new Blob([newBuffer]);
|
const blob = new Blob([newBuffer]);
|
||||||
// Store in cache but don't wait for it before returning.
|
// Store in cache but don't wait for it before returning.
|
||||||
@@ -367,6 +370,7 @@ export class Downloader {
|
@@ -424,6 +427,7 @@ export class Downloader {
|
||||||
* @param {Object} options Some download options.
|
* @param {Object} options Some download options.
|
||||||
* @param {Number} options.retries Number of times download should be retried (default: `3`)
|
* @param {Number} options.retries Number of times download should be retried (default: `3`)
|
||||||
* @param {Boolean} options.checkHash Check content integrity (default: `true`)
|
* @param {Boolean} options.checkHash Check content integrity (default: `true`)
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
* @throws {Downloader.DownloadError} if the file could not be fetched.
|
* @throws {Downloader.DownloadError} if the file could not be fetched.
|
||||||
* @throws {Downloader.BadContentError} if the downloaded content integrity is not valid.
|
* @throws {Downloader.BadContentError} if the downloaded content integrity is not valid.
|
||||||
* @returns {ArrayBuffer} the file content.
|
* @returns {ArrayBuffer} the file content.
|
||||||
@@ -375,10 +379,11 @@ export class Downloader {
|
@@ -432,10 +436,11 @@ export class Downloader {
|
||||||
const {
|
const {
|
||||||
attachment: { location, hash, size },
|
attachment: { location, hash, size },
|
||||||
} = record;
|
} = record;
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
let retried = 0;
|
let retried = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
@@ -427,9 +432,9 @@ export class Downloader {
|
@@ -484,9 +489,9 @@ export class Downloader {
|
||||||
await this._rmDirs();
|
await this._rmDirs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
let serverInfo;
|
let serverInfo;
|
||||||
try {
|
try {
|
||||||
serverInfo = await resp.json();
|
serverInfo = await resp.json();
|
||||||
@@ -443,10 +448,9 @@ export class Downloader {
|
@@ -500,10 +505,9 @@ export class Downloader {
|
||||||
},
|
},
|
||||||
} = serverInfo;
|
} = serverInfo;
|
||||||
// Make sure the URL always has a trailing slash.
|
// Make sure the URL always has a trailing slash.
|
||||||
|
@ -117,7 +117,7 @@
|
||||||
collection: this.collectionName,
|
collection: this.collectionName,
|
||||||
--- a/toolkit/components/translations/actors/TranslationsParent.sys.mjs
|
--- a/toolkit/components/translations/actors/TranslationsParent.sys.mjs
|
||||||
+++ b/toolkit/components/translations/actors/TranslationsParent.sys.mjs
|
+++ b/toolkit/components/translations/actors/TranslationsParent.sys.mjs
|
||||||
@@ -1143,7 +1143,9 @@ export class TranslationsParent extends JSWindowActorParent {
|
@@ -1034,7 +1034,9 @@ export class TranslationsParent extends JSWindowActorParent {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @type {RemoteSettingsClient} */
|
/** @type {RemoteSettingsClient} */
|
||||||
|
@ -128,7 +128,7 @@
|
||||||
TranslationsParent.#translationModelsRemoteClient = client;
|
TranslationsParent.#translationModelsRemoteClient = client;
|
||||||
client.on("sync", TranslationsParent.#handleTranslationsModelsSync);
|
client.on("sync", TranslationsParent.#handleTranslationsModelsSync);
|
||||||
return client;
|
return client;
|
||||||
@@ -1489,7 +1491,10 @@ export class TranslationsParent extends JSWindowActorParent {
|
@@ -1420,7 +1422,10 @@ export class TranslationsParent extends JSWindowActorParent {
|
||||||
|
|
||||||
/** @type {{buffer: ArrayBuffer}} */
|
/** @type {{buffer: ArrayBuffer}} */
|
||||||
const { buffer } = await client.attachments.download(
|
const { buffer } = await client.attachments.download(
|
||||||
|
@ -140,7 +140,7 @@
|
||||||
);
|
);
|
||||||
|
|
||||||
const duration = Date.now() - start;
|
const duration = Date.now() - start;
|
||||||
@@ -1540,7 +1545,9 @@ export class TranslationsParent extends JSWindowActorParent {
|
@@ -1471,7 +1476,9 @@ export class TranslationsParent extends JSWindowActorParent {
|
||||||
)) {
|
)) {
|
||||||
const download = () => {
|
const download = () => {
|
||||||
lazy.console.log("Downloading record", record.name, record.id);
|
lazy.console.log("Downloading record", record.name, record.id);
|
||||||
|
@ -151,7 +151,7 @@
|
||||||
};
|
};
|
||||||
queue.push({ download });
|
queue.push({ download });
|
||||||
}
|
}
|
||||||
@@ -1564,7 +1571,10 @@ export class TranslationsParent extends JSWindowActorParent {
|
@@ -1495,7 +1502,10 @@ export class TranslationsParent extends JSWindowActorParent {
|
||||||
onFailure: () => {
|
onFailure: () => {
|
||||||
console.error("Failed to download", record.name);
|
console.error("Failed to download", record.name);
|
||||||
},
|
},
|
||||||
|
@ -163,7 +163,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1727,7 +1737,9 @@ export class TranslationsParent extends JSWindowActorParent {
|
@@ -1659,7 +1669,9 @@ export class TranslationsParent extends JSWindowActorParent {
|
||||||
await chaosMode(1 / 3);
|
await chaosMode(1 / 3);
|
||||||
|
|
||||||
/** @type {{buffer: ArrayBuffer }} */
|
/** @type {{buffer: ArrayBuffer }} */
|
||||||
|
|
Loading…
Add table
Reference in a new issue