This commit is contained in:
Mirco Wittrien 2021-07-08 16:59:41 +02:00
parent 43cc155126
commit 54a963b092
3 changed files with 37 additions and 11 deletions

View File

@ -984,7 +984,7 @@ module.exports = (_ => {
if (tryAgain) return BDFDB.TimeUtils.timeout(_ => loadLibrary(), 10000);
else {
BDFDB.LogUtils.error(["Failed to fetch JSON from GitHub. Could not load data.json!", e2 || ""]);
b2 = loadBackup(dataPath);
b2 = loadBackup();
}
}
let InternalData;
@ -992,7 +992,7 @@ module.exports = (_ => {
catch (err) {
BDFDB.LogUtils.error(["Failed to parse fetched JSON. Could not load data.json!", err]);
b2 = null;
InternalData = JSON.parse(loadBackup(dataPath));
InternalData = JSON.parse(loadBackup());
}
if (!e && b && r.statusCode == 200) fs.writeFile(cssPath, b, _ => {});
if (!e2 && b2 && r2.statusCode == 200) fs.writeFile(dataPath, b2, _ => {});

View File

@ -2,7 +2,7 @@
* @name CustomStatusPresets
* @author DevilBro
* @authorId 278543574059057154
* @version 1.0.6
* @version 1.0.7
* @description Allows you to save Custom Statuses as Quick Select
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,12 +17,12 @@ module.exports = (_ => {
"info": {
"name": "CustomStatusPresets",
"author": "DevilBro",
"version": "1.0.6",
"version": "1.0.7",
"description": "Allows you to save Custom Statuses as Quick Select"
},
"changeLog": {
"added": {
"Online Status": "The online status now also gets saved in the preset"
"fixed": {
"Status/Overflow": "Fixed some Issues with very long Status causing overflow issues"
}
}
};
@ -289,15 +289,13 @@ module.exports = (_ => {
display: flex;
align-items: center;
}
.statusItem-33LqPf {
grid-template-rows: minmax(24px, auto) 1fr;
}
${BDFDB.dotCN._customstatuspresetsdeletebutton} {
display: flex;
margin-right: 6px;
}
${BDFDB.dotCN._customstatuspresetsstatus} {
margin-right: 6px;
flex: 0 0 auto;
}
${BDFDB.dotCN._customstatuspresetssortdivider} {
background: ${BDFDB.DiscordConstants.Colors.STATUS_GREEN};
@ -381,7 +379,9 @@ module.exports = (_ => {
className: BDFDB.disCN._customstatuspresetsstatus,
status: presets[id].status || BDFDB.DiscordConstants.StatusTypes.ONLINE
}),
presets[id].text
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextScroller, {
children: presets[id].text
})
]
}),
imageUrl: presets[id].emojiInfo && (presets[id].emojiInfo.id ? BDFDB.LibraryModules.IconUtils.getEmojiURL(presets[id].emojiInfo) : BDFDB.LibraryModules.EmojiStateUtils.getURL(presets[id].emojiInfo.name)),

View File

@ -288,7 +288,7 @@ module.exports = (_ => {
BDFDB.TimeUtils.timeout(_ => {clickedImage = null;});
});
BDFDB.PatchUtils.patch(this, (BDFDB.ModuleUtils.findByName("renderImageComponent", false).exports || {}), "renderImageComponent", {after: e => {
BDFDB.PatchUtils.patch(this, BDFDB.LibraryComponents.MediaComponentUtils, "renderImageComponent", {after: e => {
if (this.settings.general.showAsHeader && e.returnValue && e.returnValue.type && (e.returnValue.type.displayName == "LazyImageZoomable" || e.returnValue.type.displayName == "LazyImage") && e.methodArguments[0].original && e.methodArguments[0].src.indexOf("https://media.discordapp.net/attachments") == 0 && (e.methodArguments[0].className || "").indexOf(BDFDB.disCN.embedmedia) == -1 && (e.methodArguments[0].className || "").indexOf(BDFDB.disCN.embedthumbnail) == -1) {
return BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.embedwrapper,
@ -1211,6 +1211,19 @@ module.exports = (_ => {
toast_save_failed: "{{var0}} не можа да бъде запазен в '{{var1}}'",
toast_save_success: "{{var0}} бе запазено в '{{var1}}'"
};
case "cs": // Czech
return {
context_copy: "Zkopírovat {{var0}}",
context_lenssize: "Velikost lupy",
context_saveas: "Uložit {{var0}} jako...",
context_searchwith: "Hledat {{var0}} pomocí...",
context_view: "Zobrazit {{var0}}",
submenu_disabled: "Vše zakázáno",
toast_copy_failed: "{{var0}} nemohl být zkopírován do schránky",
toast_copy_success: "{{var0}} byl zkopírován do schránky",
toast_save_failed: "{{var0}} nemohl být uložen do '{{var1}}'",
toast_save_success: "{{var0}} bylo uložen do '{{var1}}'"
};
case "da": // Danish
return {
context_copy: "Kopiér {{var0}}",
@ -1289,6 +1302,19 @@ module.exports = (_ => {
toast_save_failed: "{{var0}} n'a pas pu être enregistré dans '{{var1}}'",
toast_save_success: "{{var0}} a été enregistré dans '{{var1}}'"
};
case "hi": // Hindi
return {
context_copy: "कॉपी {{var0}}",
context_lenssize: "लेंस का आकार",
context_saveas: "{{var0}} को इस रूप में सेव करें...",
context_searchwith: "इसके साथ {{var0}} खोजें ...",
context_view: "देखें {{var0}}",
submenu_disabled: "सभी अक्षम",
toast_copy_failed: "{{var0}} को क्लिपबोर्ड पर कॉपी नहीं किया जा सका",
toast_copy_success: "{{var0}} को क्लिपबोर्ड पर कॉपी किया गया था",
toast_save_failed: "{{var0}} '{{var1}}' में सहेजा नहीं जा सका",
toast_save_success: "{{var0}} '{{var1}}' में सहेजा गया था"
};
case "hr": // Croatian
return {
context_copy: "Kopiraj {{var0}}",