From 725ebd5835bfdb4c41fb0e2be195feb781fb7141 Mon Sep 17 00:00:00 2001
From: AAGaming <aagaming@riseup.net>
Date: Sat, 29 Jun 2024 17:41:03 -0400
Subject: fix: add .bind to legacy plugin API to fix filepicker

---
 frontend/src/plugin-loader.tsx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'frontend/src/plugin-loader.tsx')

diff --git a/frontend/src/plugin-loader.tsx b/frontend/src/plugin-loader.tsx
index e84343c4..59d6b5bd 100644
--- a/frontend/src/plugin-loader.tsx
+++ b/frontend/src/plugin-loader.tsx
@@ -625,9 +625,9 @@ class PluginLoader extends Logger {
       routerHook: this.routerHook,
       toaster: this.toaster,
       // Legacy
-      callServerMethod: this.callServerMethod,
-      openFilePicker: this.openFilePickerLegacy,
-      openFilePickerV2: this.openFilePicker,
+      callServerMethod: this.callServerMethod.bind(this),
+      openFilePicker: this.openFilePickerLegacy.bind(this),
+      openFilePickerV2: this.openFilePicker.bind(this),
       // Legacy
       async callPluginMethod(methodName: string, args = {}) {
         return DeckyBackend.call<[pluginName: string, methodName: string, kwargs: any], any>(
@@ -637,7 +637,7 @@ class PluginLoader extends Logger {
           args,
         );
       },
-      fetchNoCors: this.legacyFetchNoCors,
+      fetchNoCors: this.legacyFetchNoCors.bind(this),
       executeInTab: DeckyBackend.callable<
         [tab: String, runAsync: Boolean, code: string],
         { success: boolean; result: any }
-- 
cgit v1.2.3

