Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon store #1193

Open
wants to merge 96 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
49769ac
Push
Strencher Jan 30, 2022
385782d
Prevent propagation
Strencher Jan 30, 2022
4122125
fix search styling
Tropix126 Jan 30, 2022
0740fd9
(unsuccessful) attempt to fix public servers
Tropix126 Jan 30, 2022
5a087c0
update blankstate messages to direct to the store
Tropix126 Jan 30, 2022
96160fd
fix onKeyDown
Tropix126 Jan 30, 2022
8dbdd5a
fix customcss close button size
Tropix126 Jan 30, 2022
1933064
WIP detailed addon view style
Strencher Jan 30, 2022
8f5b164
fix addon editing
Tropix126 Jan 31, 2022
1b9ebec
Merge branch 'addon-store' of https://github.com/Strencher/BandagedBe…
Tropix126 Jan 31, 2022
7f8dd37
get rid of unnecessary px units in width/height attributes
Tropix126 Jan 31, 2022
f181b58
move hardcoded stuff to strings
Tropix126 Jan 31, 2022
28a4a52
fetchReadme refactors
Tropix126 Feb 5, 2022
df1da69
begin some work on StoreDetails
Tropix126 Feb 5, 2022
2ed3083
temporarily disable store pages
Tropix126 Feb 17, 2022
65b7ac8
Merge with upstream
Strencher Feb 21, 2022
db749ef
Merge remote-tracking branch 'zerebos/main' into addon-store
Strencher Feb 21, 2022
a46aae9
Fix strings when language is changed
Strencher Feb 23, 2022
421bd8d
Re-activate store, add released date & "new" badge
Strencher Feb 23, 2022
f837550
pagination a11y + overflow handling
Tropix126 Mar 6, 2022
6b967fa
Merge branch 'addon-store' of https://github.com/Strencher/BandagedBe…
Tropix126 Mar 6, 2022
f6f6f05
minr pagination layout styling update
Tropix126 Mar 6, 2022
964621a
refactor badge system
Tropix126 Mar 6, 2022
24288c4
these two files didn't commit
Tropix126 Mar 6, 2022
936ba95
i18n fixes
Tropix126 Mar 6, 2022
33710c0
WIP: store protocol
Strencher Mar 6, 2022
b04f78e
(broken) store card embeds
Tropix126 Mar 7, 2022
d58d8e4
useless import
Tropix126 Mar 7, 2022
5aa2e37
adapt to new API, fix embedded store cards
Tropix126 Mar 8, 2022
a02fd5e
check for addon id before rendering embed card
Tropix126 Mar 8, 2022
0cf36fd
some addonlist cleanup
Tropix126 Mar 11, 2022
6fed760
wrong string order
Tropix126 Mar 11, 2022
f119d3b
fix regression with addon deletion
Tropix126 Mar 15, 2022
ea75608
refactor store embeds
Tropix126 Mar 16, 2022
6dbc92b
EmbeddedStoreCard margin no longer needed
Tropix126 Mar 16, 2022
07729f6
stricter nullcheck
Tropix126 Mar 16, 2022
b862dda
fix regex matching with betterdiscord:// protocols
Tropix126 Mar 16, 2022
4e67eec
handle multiple protocols in the same message
Tropix126 Mar 16, 2022
5ec3891
use correct strings/colors for addon cards
Tropix126 Mar 16, 2022
d6e16b9
ability to disable the store
Tropix126 Mar 16, 2022
f0ea3e1
restructure confirmDelete to AddonManager and hook up to StoreCard
Tropix126 Mar 17, 2022
fec6729
disable details view again, remove some console logs
Tropix126 Mar 17, 2022
2211da3
lint
Tropix126 Mar 17, 2022
1819ec8
fix SimpleMarkdown patch, improve data fetching
Tropix126 Mar 17, 2022
9f71475
cache individual fetches
Tropix126 Mar 17, 2022
ade7879
fix installation matching
Tropix126 Mar 19, 2022
c223879
use correct link to developer profile
Tropix126 Mar 19, 2022
2b0d7ad
check for addon ID before attempting to render installation modal
Tropix126 Mar 19, 2022
15f2816
fix export capitalization
Tropix126 Mar 20, 2022
2858a9a
fix addon reloading
Tropix126 Mar 20, 2022
5cf9d27
compatibility with BD's manual reload setting
Tropix126 Mar 20, 2022
3c854e6
keyboard-navigable installation modals
Tropix126 Mar 21, 2022
019ddb1
update installed list/store when addons are deleted and autoReload di…
Tropix126 Mar 21, 2022
003ce7d
move common store functions into BdWebApi module
Tropix126 Mar 21, 2022
daeab7e
fix cache-related crash
Tropix126 Mar 21, 2022
e48bedf
BdWebApi jsdoc
Tropix126 Mar 21, 2022
bd6f922
handle shift key clicking
Tropix126 Mar 21, 2022
63e9dd7
fix pagination styling again
Tropix126 Mar 21, 2022
0426a78
add an option to automatically enable addons on install
Tropix126 Mar 23, 2022
91e19be
refactor some data flow, adjust install modal colors
Tropix126 Mar 26, 2022
c74e545
lint
Tropix126 Mar 26, 2022
31601c2
restructure store dataflow (again)
Tropix126 Mar 26, 2022
aa35bb2
remove a method I accidentally left in
Tropix126 Mar 30, 2022
296684b
remove error handling tempfix that I accidentally included
Tropix126 Apr 9, 2022
f723d64
actually revert injector to how it ran before
Tropix126 Apr 11, 2022
ca764c0
clean up boilerplate in embeds
Tropix126 Apr 14, 2022
ef439c2
Merge remote-tracking branch 'upstream/main' into addon-store
Tropix126 Apr 14, 2022
caf845b
correct JSDoc types
Tropix126 Apr 14, 2022
b126683
fix EmbeddedStoreCard crash
Tropix126 Apr 15, 2022
f72b459
Switch to API v2
Tropix126 May 24, 2022
a70d83a
lint
Tropix126 May 24, 2022
9ed638a
get rid of unused class properties plugin
Tropix126 May 24, 2022
8905b4d
package.json didn't commit
Tropix126 May 24, 2022
95ccea8
Remove code that's out of scope for this PR
Tropix126 May 24, 2022
8643fcc
revert jsconfig to not include any new alias
Tropix126 May 24, 2022
4c15315
add a missing react import
Tropix126 May 24, 2022
4a5c027
Add enable sort to new addon page, code cleanup
Tropix126 Aug 3, 2022
544161b
Merge remote-tracking branch 'upstream/main' into addon-store
Tropix126 Aug 3, 2022
25bef45
Fix enabled sort, cleanup embedding logic
Tropix126 Aug 3, 2022
17bc615
show localized toast on connect error
Tropix126 Aug 3, 2022
63ef116
Merge remote-tracking branch 'upstream/main' into addon-store
Tropix126 Aug 3, 2022
402d25a
Restructure store data flow (see comments)
Tropix126 Aug 6, 2022
8db9a22
Start removing discord modules from the store
Tropix126 Aug 6, 2022
2009a4d
update pagination strings
Tropix126 Aug 6, 2022
d5d115e
remove double semicolons - how did this even happen?
Tropix126 Aug 9, 2022
b1653e6
fix review problems
Tropix126 Aug 31, 2022
574b4ea
properly render MaskedLink
Tropix126 Aug 31, 2022
e5c7a0b
optional chain so that the getter won't throw
Tropix126 Aug 31, 2022
5b995e3
remove leftover autoload handling code
Tropix126 Aug 31, 2022
89fa89f
Merge remote-tracking branch 'upstream/main' into addon-store
Tropix126 Sep 1, 2022
b7affd6
add back ClassName import
Tropix126 Sep 1, 2022
25dff53
lint, move various methods to async
Tropix126 Sep 3, 2022
272d666
remove verbose toast, pagination updates
Tropix126 Sep 3, 2022
b48981f
use correct installAddon method in embed cards
Tropix126 Sep 3, 2022
aa3f487
Merge remote-tracking branch 'upstream/main' into addon-store
Tropix126 Oct 11, 2022
b798ef0
Fix store to work under SWC/1.8.0 codebase
Tropix126 Oct 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"compileError": "Nepodařilo se zkompilovat.",
"wasUnloaded": "Doplněk {{name}} byl odnačten.",
"blankSlateHeader": "Nemáš žádné/žádný {{type}}!",
"blankSlateMessage": "Najdi si nějaké na [tomto webu]({{link}}) a přidej je do své {{type}} složky."
"blankSlateMessage": ""
},
"CustomCSS": {
"confirmationText": "Máš neuložené změny ve vlastním CSS. Zavřením tohoto okna je všechny ztratíš.",
Expand Down
2 changes: 1 addition & 1 deletion assets/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"compileError": "Konnte nicht kompiliert werden.",
"wasUnloaded": "{{name}} wurde entladen.",
"blankSlateHeader": "Du besitzt keine {{type}}s!",
"blankSlateMessage": "Lade dir welche von [this website]({{link}}) herunter und füge sie deinem {{type}} Ordner hinzu."
"blankSlateMessage": ""
},
"CustomCSS": {
"confirmationText": "Du hast ungespeicherte Änderungen im Custom-CSS. Durch das Schließen dieses Fensters verlierst du alle Änderungen.",
Expand Down
37 changes: 35 additions & 2 deletions assets/locales/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
},
"addons": {
"name": "Addon Manager",
"store": {
"name": "Addon Store",
"note": "Enables the Store, allowing you to download themes and plugins remotely."
},
"autoEnable": {
"name": "Enable Addons on Install",
"note": "Automatically enables addons when they are installed via the store."
},
"addonErrors": {
"name": "Show Addon Errors",
"note": "Shows a modal with plugin/theme errors"
Expand Down Expand Up @@ -203,6 +211,12 @@
}
},
"Addons": {
"installed": "Installed",
"install": "Install",
"store": "Store",
"view": "View",
"list": "List",
"grid": "Grid",
"title": "{{name}} v{{version}} by {{author}}",
"byline": "by {{author}}",
"openFolder": "Open {{type}} Folder",
Expand All @@ -216,10 +230,13 @@
"name": "Name",
"author": "Author",
"version": "Version",
"description": "Description",
"added": "Date Added",
"uploaded": "Date Uploaded",
"modified": "Date Modified",
"isEnabled": "Enabled",
"search": "Search {{type}}",
"noResults": "We searched far and wide. Unfortunately, no results were found.",
"editAddon": "Edit",
"deleteAddon": "Delete",
"confirmDelete": "Are you sure you want to delete {{name}}?",
Expand All @@ -242,7 +259,7 @@
"compileError": "Could not be compiled. See console for details.",
"wasUnloaded": "{{name}} was unloaded.",
"blankSlateHeader": "You don't have any {{type}}s!",
"blankSlateMessage": "Grab some from [this website]({{link}}) and add them to your {{type}} folder."
"blankSlateMessage": "Download some from the store to get started."
},
"CustomCSS": {
"confirmationText": "You have unsaved changes to your Custom CSS. Closing this window will lose all those changes.",
Expand All @@ -251,7 +268,22 @@
"openNative": "Open in System Editor",
"openDetached": "Detach Window",
"settings": "Editor Settings",
"editorTitle": "Custom CSS Editor"
"editorTitle": "Custom CSS Editor",
"writeError": "Failed to write {{type}} to disk."
},
"Store": {
"connectionError": "Failed to connect to Store.",
"connectionErrorMessage": "There was an error connecting to the store, it's possible our website/api is down. Would you like to retry?",
"downloadError": "Failed to download {{type}}.",
"installConfirmation": "Do you want to add this to your installed {{type}}s?",
"back": "Back",
"next": "Next",
"new": "New",
"likes": "Likes",
"likesAmount": "{{amount}} likes",
"downloads": "Downloads",
"downloadsAmount": "{{amount}} downloads",
"uploadDate": "Uploaded on {{date}}"
},
"Emotes": {
"loading": "Loading emotes in the background do not reload.",
Expand Down Expand Up @@ -289,6 +321,7 @@
"cancel": "Cancel",
"nevermind": "Nevermind",
"close": "Close",
"retry": "Retry",
"name": "Name",
"message": "Message",
"error": "Error",
Expand Down
2 changes: 1 addition & 1 deletion assets/locales/es-es.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"compileError": "No se ha podido compilar.",
"wasUnloaded": "{{name}} ha sido descargado.",
"blankSlateHeader": "¡No tienes {{type}}s!",
"blankSlateMessage": "Consigue alguno en [esta página web]({{link}}) y añadelos a tu carpeta de {{type}}."
"blankSlateMessage": ""
},
"CustomCSS": {
"confirmationText": "Tienes cambios sin guardar en tu CSS Personalizado. Al cerrar esta ventana se perderán todos los cambios.",
Expand Down
2 changes: 1 addition & 1 deletion assets/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"compileError": "Compilation impossible.",
"wasUnloaded": "{{name}} a été déchargé.",
"blankSlateHeader": "Vous n'avez pas de {{type}}!",
"blankSlateMessage": "Récupère-les depuis [ce site]({{link}}) et ajoute-les dans ton dossier {{type}}."
"blankSlateMessage": ""
},
"CustomCSS": {
"confirmationText": "Vous avez des changements non sauvegardés dans votre CSS Personnalisé. Fermer cette fenêtre vous fera perdre ces changements.",
Expand Down
2 changes: 1 addition & 1 deletion assets/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"compileError": "Błąd kompilacji.",
"wasUnloaded": "Dodatek {{name}} został odładowany.",
"blankSlateHeader": "Wygląda na to, że nic tu nie ma!",
"blankSlateMessage": "Pobierz nowe dodatki z [tej strony]({{link}}) i przenieś je do odpowiedniego folderu."
"blankSlateMessage": ""
},
"CustomCSS": {
"confirmationText": "Masz niezapisane zmiany w swoim niestandardowym kodzie CSS. Zamknięcie tego okienka spowoduje utratę danych.",
Expand Down
2 changes: 1 addition & 1 deletion assets/locales/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"compileError": "Não foi possível compilar.",
"wasUnloaded": "{{name}} foi descarregado.",
"blankSlateHeader": "Você não tem nenhum {{type}}!",
"blankSlateMessage": "Baixe alguns [desse website]({{link}}) e os adicione na sua pasta de {{type}}s."
"blankSlateMessage": ""
},
"CustomCSS": {
"confirmationText": "Você tem mudanças ainda não salvas no seu CSS Personalizado. Fechar essa janela fará você perder todas elas.",
Expand Down
2 changes: 1 addition & 1 deletion assets/locales/pt-pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"compileError": "Não foi possível compilar.",
"wasUnloaded": "{{name}} foi descarregado.",
"blankSlateHeader": "Não tem nenhum {{type}}!",
"blankSlateMessage": "Pega um pouco deste [this website]({{link}}) e adiciona eles à tua pasta {{type}}."
"blankSlateMessage": ""
},
"CustomCSS": {
"confirmationText": "Tem alterações não guardadas no CSS Personalizado. Se fechar esta janela irá perder essas alterações.",
Expand Down
2 changes: 1 addition & 1 deletion assets/locales/ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"compileError": "Nu s-a putut incărca.",
"wasUnloaded": "{{name}} a fost dezactivat.",
"blankSlateHeader": "Nu ai nici un {{type}}!",
"blankSlateMessage": "Descarcă câteva din [acest website]({{link}}) și adaugă-le in folder-ul tău {{type}}."
"blankSlateMessage": ""
},
"CustomCSS": {
"confirmationText": "Ai modificări nesalvate in CSS-ul personalizat. Închiderea acestei ferestre va duce la anularea schimbărilor.",
Expand Down
2 changes: 1 addition & 1 deletion assets/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"compileError": "Не удалось скомпилировать.",
"wasUnloaded": "{{name}} был выгружен.",
"blankSlateHeader": "У вас нету {{type}}",
"blankSlateMessage": "Возьмите что-то с [этого сайта]({{link}}) и добавьте их в свою папку {{type}}."
"blankSlateMessage": ""
},
"CustomCSS": {
"confirmationText": "У вас есть не сохраненные изменения в быстром CSS. При закрытии этого окна все изменения будут потеряны.",
Expand Down
2 changes: 1 addition & 1 deletion assets/locales/sk.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"compileError": "Nepodarilo sa zostaviť.",
"wasUnloaded": "{{name}} bol odpojený.",
"blankSlateHeader": "Nenachádza sa žiadny/žiadna {{type}}!",
"blankSlateMessage": "Nájdi nejaké na [tejto stránke]({{link}}) a pridaj ich do zložky pre {{type}}."
"blankSlateMessage": ""
},
"CustomCSS": {
"confirmationText": "Máte neuložené zmeny pre Custom CSS. Zatvorením tohto okna stratíte všetky zmeny.",
Expand Down
2 changes: 1 addition & 1 deletion assets/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"compileError": "Derlenemedi.",
"wasUnloaded": "{{name}} çıkarıldı.",
"blankSlateHeader": "Hiç {{type}}(a/e)arın yok!",
"blankSlateMessage": "[Bu siteden]({{link}}) al ve {{type}} klasörüne ekle."
"blankSlateMessage": ""
},
"CustomCSS": {
"confirmationText": "Özel CSS'inde kaydedilmemiş değişimler var. Bu pencereyi kapatmak değişikliklerin kaybolmasına yol açar.",
Expand Down
2 changes: 1 addition & 1 deletion assets/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"compileError": "无法编译。",
"wasUnloaded": "已卸载{{name}}。",
"blankSlateHeader": "你还添加任何{{type}}!",
"blankSlateMessage": "你可以在[此网站]({{link}})中获取,并将其添加到你的{{type}}文件夹中。"
"blankSlateMessage": ""
},
"CustomCSS": {
"confirmationText": "你还有未保存的更改,关闭此窗口将失去所有对自定义样式所做的更改。",
Expand Down
2 changes: 1 addition & 1 deletion assets/locales/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"compileError": "無法編譯。",
"wasUnloaded": "已卸載{{name}}。",
"blankSlateHeader": "你还未添加任何{{type}}!",
"blankSlateMessage": "你可以在[此网站]({{link}})中獲取,並將其添加到你的{{type}}資料夾中。"
"blankSlateMessage": ""
},
"CustomCSS": {
"confirmationText": "你还有未保存的更改,關閉此窗口將失去所有對客製化樣式所做的更改。",
Expand Down
164 changes: 164 additions & 0 deletions renderer/src/builtins/addons/store.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
import {React, WebpackModules, BdWebApi, Strings} from "modules";
import {Web} from "data";

import Builtin from "../../structs/builtin";
import PluginManager from "../../modules/pluginmanager";
import ThemeManager from "../../modules/thememanager";
import StoreCard from "../../ui/settings/addonlist/storecard";
import Modals from "../../ui/modals";
import Toasts from "../../ui/toasts";

import {URL} from "url";

const PROTOCOL_REGEX = new RegExp("<([^: >]+:/[^ >]+)>", "g");
const BD_PROTOCOL = "betterdiscord:";
const BD_PROTOCOL_REGEX = new RegExp(BD_PROTOCOL + "//", "i");

export default new class Store extends Builtin {
get name() {return "Store";}
get category() {return "addons";}
get id() {return "store";}

enabled() {
this.patchMarkdownParser();
this.patchTrustedModule();
this.patchEmbeds();
}

disabled() {
this.unpatchAll();
}

patchEmbeds() {
const MessageAccessories = WebpackModules.getByProps("MessageAccessories")?.MessageAccessories;

if (!MessageAccessories?.prototype.renderEmbeds) return;

this.instead(MessageAccessories.prototype, "renderEmbeds", (thisObject, methodArguments, renderEmbeds) => {
const embeds = Reflect.apply(renderEmbeds, thisObject, methodArguments);
const matchedProtocols = methodArguments[0]?.content.match(PROTOCOL_REGEX)?.map(match => {
const url = new URL(match.replace(/\s+/g, " ").replaceAll(/[<>]+/g, "").trim());

if (url.hostname === "addon" && url.protocol === BD_PROTOCOL) return url;
}).filter(m => m != null);

if (!matchedProtocols || !matchedProtocols?.length) return embeds;

return (embeds ?? []).concat(matchedProtocols.map((url) => {
Strencher marked this conversation as resolved.
Show resolved Hide resolved
const parameter = url.pathname.slice(1);
const addonId = Number.isNaN(Number(parameter)) ? parameter : Number(parameter);
if (!addonId) return null;

return React.createElement(EmbeddedStoreCard, {addonId});
}));
});
}

patchTrustedModule() {
const TrustedModule = WebpackModules.getByProps("isLinkTrusted", "handleClick");

if (!TrustedModule) return;

this.instead(TrustedModule, "handleClick", (thisObject, methodArguments, handleClick) => {
const [{href, onClick}, event] = methodArguments;

if (BD_PROTOCOL_REGEX.test(href)) {
if (typeof onClick === "function") onClick(event);

if (event) {
event.preventDefault();
event.stopPropagation();
}

return true;
}

return Reflect.apply(handleClick, thisObject, methodArguments);
});
}

patchMarkdownParser() {
const SimpleMarkdown = WebpackModules.getByProps("parseTopic", "defaultRules");

if (!SimpleMarkdown?.defaultRules?.link) return;

this.after(SimpleMarkdown.defaultRules.link, "react", (_, [{target: url}], returnValue) => {
if (!BD_PROTOCOL_REGEX.test(url)) return;

return this.renderContent(url, returnValue);
});
}

renderContent(path, link) {
const url = new URL(path);

if (url.hostname === "addon") {
const parameter = url.pathname.slice(1);
const addonId = Number.isNaN(Number(parameter)) ? parameter : Number(parameter);
if (!addonId) return link;

link.props.onClick = async (event) => {
const addon = await BdWebApi.getAddon(addonId);

if (addon?.type) {
event.preventDefault();
window.open((Web.PAGES[addon.type] + (typeof(addonId) === "number" ? "?id=" : "/") + addonId), "_blank");
}
};
}

return link;
}
};

class EmbeddedStoreCard extends React.Component {
constructor(props) {
super(props);

this.state = {
addon: null
};
}

componentDidMount() {
BdWebApi.getAddon(this.props.addonId).then(data => {
if (data?.id) this.setState({addon: data});
});
}

get manager() {
return this.state.addon?.type === "theme" ? ThemeManager : PluginManager;
}

async install(id, filename) {
await BdWebApi.getAddonContents(id).then(contents => {
return this.manager.installAddon(contents, filename);
}).catch(err => {
Toasts.error(Strings.Store.downloadError.format({type: this.state.addon.type}), err);
});
}

render() {
const {addon} = this.state;

return addon ? React.createElement(StoreCard, {
...addon,
key: addon.id,
className: "bd-store-card-embedded",
thumbnail: Web.ENDPOINTS.thumbnail(addon.thumbnail_url),
filename: addon.file_name,
releaseDate: new Date(addon.release_date),
isInstalled: this.manager.isLoaded(addon.file_name),
onInstall: () => Modals.showInstallationModal({
...addon,
thumbnail: Web.ENDPOINTS.thumbnail(addon.thumbnail_url),
filename: addon.file_name,
releaseDate: new Date(addon.release_date),
onInstall: () => this.install(addon.id, addon.file_name)
}),
onForceInstall: () => this.install(addon.id, addon.file_name),
onDelete: () => this.manager.confirmAddonDelete(addon.file_name),
onForceDelete: () => this.manager.deleteAddon(addon.file_name)
}) : null;
}
}
2 changes: 2 additions & 0 deletions renderer/src/builtins/builtins.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export {default as PublicServers} from "./general/publicservers";
export {default as VoiceDisconnect} from "./general/voicedisconnect";
export {default as MediaKeys} from "./general/mediakeys";

export {default as Store} from "./addons/store";

export {default as EmoteModule} from "./emotes/emotes";
export {default as EmoteMenu} from "./emotes/emotemenu";
// export {default as EmoteAutocaps} from "./emotes/emoteautocaps";
Expand Down
3 changes: 2 additions & 1 deletion renderer/src/data/data.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export {default as Config} from "./config";
export {default as EmoteConfig} from "./emotesettings";
export {default as SettingsConfig} from "./settings";
export {default as Changelog} from "./changelog";
export {default as Changelog} from "./changelog";
export {default as Web} from "./web";
2 changes: 2 additions & 0 deletions renderer/src/data/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export default [
collapsible: true,
shown: false,
settings: [
{type: "switch", id: "store", value: true},
{type: "switch", id: "autoEnable", value: false},
{type: "switch", id: "addonErrors", value: true},
{type: "switch", id: "autoReload", value: true},
{type: "dropdown", id: "editAction", value: "detached", options: [{value: "detached"}, {value: "system"}]}
Expand Down
Loading