diff --git a/main.meta.js b/main.meta.js index 3aaf646..b5e0cb8 100644 --- a/main.meta.js +++ b/main.meta.js @@ -1,7 +1,7 @@ // ==UserScript== // @name PNGExtraEmbed // @namespace https://coom.tech/ -// @version 0.144 +// @version 0.145 // @description uhh // @author You // @match https://boards.4channel.org/* diff --git a/main.user.js b/main.user.js index a049c90..244883e 100644 --- a/main.user.js +++ b/main.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name PNGExtraEmbed // @namespace https://coom.tech/ -// @version 0.144 +// @version 0.145 // @description uhh // @author You // @match https://boards.4channel.org/* @@ -11643,7 +11643,7 @@ let total = 0; fireNotification("info", `Uploading ${injs.length} files...`); return await Promise.all(injs.map(async (inj) => { - const ret = await filehosts[csettings2.fhost].uploadFile(await buildPeeFile(inj)); + const ret = await filehosts[csettings2.fhost || 0].uploadFile(await buildPeeFile(inj)); fireNotification("info", `Uploaded files [${++total}/${injs.length}] ${ret}`); return ret; })); diff --git a/src/utils.ts b/src/utils.ts index 61b1789..a611dc8 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -182,7 +182,7 @@ export const uploadFiles = async (injs: File[]) => { let total = 0; fireNotification('info', `Uploading ${injs.length} files...`); return await Promise.all(injs.map(async inj => { - const ret = await filehosts[csettings.fhost].uploadFile(await buildPeeFile(inj)); + const ret = await filehosts[csettings.fhost || 0].uploadFile(await buildPeeFile(inj)); fireNotification('info', `Uploaded files [${++total}/${injs.length}] ${ret}`); return ret; }));