From 0c59b843246bd956b1d47adfc534924b40e26761 Mon Sep 17 00:00:00 2001 From: AlphaX-Projects <77661270+AlphaX-Projects@users.noreply.github.com> Date: Mon, 19 Jun 2023 18:23:19 +0200 Subject: [PATCH] Add tooltip and fix no name --- core/src/components/show-plugin.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/core/src/components/show-plugin.js b/core/src/components/show-plugin.js index 6760db6b..0080dad1 100644 --- a/core/src/components/show-plugin.js +++ b/core/src/components/show-plugin.js @@ -907,7 +907,7 @@ class NavBar extends connect(store)(LitElement) {
add
- ${translate("tabmenu.tm19")} + ${translate("tabmenu.tm19")} @@ -1025,17 +1025,16 @@ class NavBar extends connect(store)(LitElement) { } async addToMyMenuPlugins() { - this.mwcIcon = '' this.pluginType = this.shadowRoot.getElementById("pluginTypeInput").value - this.pluginName = this.shadowRoot.getElementById('pluginNameInput').value - - var oldMenuPlugs = JSON.parse(localStorage.getItem("myMenuPlugs") || "[]") if (this.pluginType === "reject") { let myplugerr = get("tabmenu.tm25") parentEpml.request('showSnackBar', `${myplugerr}`) return false } else if (this.pluginType === "0") { + this.mwcIcon = '' + this.pluginName = this.shadowRoot.getElementById('pluginNameInput').value + if (this.pluginName === "Q-Blog") { this.mwcIcon = 'rss_feed' } else if (this.pluginName === "Q-Mail") { @@ -1044,6 +1043,8 @@ class NavBar extends connect(store)(LitElement) { this.mwcIcon = 'apps' } + var oldMenuPlugs = JSON.parse(localStorage.getItem("myMenuPlugs") || "[]") + const newMenuPlugsItem = { "url": "myapp", "domain": "core", @@ -1056,7 +1057,7 @@ class NavBar extends connect(store)(LitElement) { } const validatePluginName = async () => { - if (this.pluginName.length === 0) { + if (this.pluginType === "0" && this.pluginName.length == 0) { let myplugstring1 = get("walletpage.wchange50") parentEpml.request('showSnackBar', `${myplugstring1}`) return false @@ -1071,7 +1072,7 @@ class NavBar extends connect(store)(LitElement) { this.myPluginNameRes = res }) - if (this.myPluginNameRes === undefined || this.myPluginNameRes.length == 0 ) { + if (this.myPluginNameRes === undefined || this.myPluginNameRes.length == 0) { myPluginName = false } else { myPluginName = true @@ -1099,8 +1100,13 @@ class NavBar extends connect(store)(LitElement) { return false } } else if (this.pluginType === "1") { + this.mwcIcon = '' + this.pluginName = this.shadowRoot.getElementById('pluginNameInput').value + this.mwcIcon = 'web' + var oldMenuPlugs = JSON.parse(localStorage.getItem("myMenuPlugs") || "[]") + const newMenuPlugsItem = { "url": "myapp", "domain": "core", @@ -1113,7 +1119,7 @@ class NavBar extends connect(store)(LitElement) { } const validatePluginName = async () => { - if (this.pluginName.length === 0) { + if (this.pluginType === "1" && this.pluginName.length == 0) { let myplugstring1 = get("walletpage.wchange50") parentEpml.request('showSnackBar', `${myplugstring1}`) return false @@ -1205,7 +1211,7 @@ class NavBar extends connect(store)(LitElement) { renderRemoveIcon(appurl, appicon, appname, appplugin) { if (appurl === 'myapp') { return html` -
+
backspace