From 8b3f569a09db9daf7748426f916a66591159928f Mon Sep 17 00:00:00 2001
From: AAGaming <aa@mail.catvibers.me>
Date: Sun, 21 Aug 2022 16:41:25 -0400
Subject: Add plugin updater, notification badge, fixes

---
 frontend/src/index.tsx | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'frontend/src/index.tsx')

diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx
index 11aabc9f..08b37d15 100644
--- a/frontend/src/index.tsx
+++ b/frontend/src/index.tsx
@@ -38,15 +38,14 @@ if (!window.webpackJsonp || window.webpackJsonp.deckyShimmed) {
 }
 
 (async () => {
-  window.deckyHasLoaded = true;
   window.deckyAuthToken = await fetch('http://127.0.0.1:1337/auth/token').then((r) => r.text());
 
   window.DeckyPluginLoader?.dismountAll();
   window.DeckyPluginLoader?.deinit();
 
   window.DeckyPluginLoader = new PluginLoader();
-  window.importDeckyPlugin = function (name: string) {
-    window.DeckyPluginLoader?.importPlugin(name);
+  window.importDeckyPlugin = function (name: string, version: string) {
+    window.DeckyPluginLoader?.importPlugin(name, version);
   };
 
   window.syncDeckyPlugins = async function () {
@@ -57,8 +56,10 @@ if (!window.webpackJsonp || window.webpackJsonp.deckyShimmed) {
       })
     ).json();
     for (const plugin of plugins) {
-      if (!window.DeckyPluginLoader.hasPlugin(plugin)) window.DeckyPluginLoader?.importPlugin(plugin);
+      if (!window.DeckyPluginLoader.hasPlugin(plugin.name))
+        window.DeckyPluginLoader?.importPlugin(plugin.name, plugin.version);
     }
+    window.DeckyPluginLoader.checkPluginUpdates();
   };
 
   setTimeout(() => window.syncDeckyPlugins(), 5000);
-- 
cgit v1.2.3

