From 6fc03bda743976a016ce3056401770e7cfbb105e Mon Sep 17 00:00:00 2001 From: Brian Broll Date: Wed, 2 Jun 2021 15:47:30 -0500 Subject: [PATCH] Ensure extensions can only be installed once. Fixes #2029 (#2030) --- .../panels/ForgeActionButton/LibraryDialog.js | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/visualizers/panels/ForgeActionButton/LibraryDialog.js b/src/visualizers/panels/ForgeActionButton/LibraryDialog.js index defcff215..06a570234 100644 --- a/src/visualizers/panels/ForgeActionButton/LibraryDialog.js +++ b/src/visualizers/panels/ForgeActionButton/LibraryDialog.js @@ -57,10 +57,28 @@ define([ row.append(data); icon.text('clear'); - icon.on('click', () => this.uninstall(libraryInfo)); + icon.on('click', () => { + icon.remove(); + row.removeClass('success'); + + badge.text('Uninstalling'); + badge.css('font-style', 'italic'); + row.addClass('warning'); + this.uninstall(libraryInfo); + }); } else { icon.text('get_app'); - icon.on('click', () => this.import(libraryInfo)); + icon.on('click', () => { + icon.remove(); + row.addClass('warning'); + let badge = $(''); + badge.css('font-style', 'italic'); + badge.text('Installing'); + data.append(badge); + badge.addClass('new badge'); + row.append($('')); + this.import(libraryInfo); + }); } data = $(''); data.append(icon);