From 61ec923ad994967b68a9dbeae8820f2ed209c108 Mon Sep 17 00:00:00 2001 From: Aune <31650531+aunefyren@users.noreply.github.com> Date: Mon, 30 Jan 2023 13:33:57 +0100 Subject: [PATCH] Added link mode to order --- web/js/index.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/web/js/index.js b/web/js/index.js index 6d1f7b5..084ee71 100644 --- a/web/js/index.js +++ b/web/js/index.js @@ -289,7 +289,7 @@ function get_user_links(cookie) { } // Contact the Wrapperr API and get configuration details. Start processes based on the result -function get_wrapper_version() { +function get_wrapper_version(link_mode, hash) { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { @@ -342,12 +342,18 @@ function get_wrapper_version() { // Set the 'configured' option in the JS variable wrapperr_configured = result.wrapperr_configured; - + if(result.wrapperr_root != "") { api_url = window.location.origin + "/" + result.wrapperr_root + "/api/"; console.log("URL: " + api_url) } - + + // If link mode, call the API and return form here + if(link_mode) { + wrapped_link_actions(hash); + return; + } + // Change search function to use Plex search instead if(!result.plex_auth) { wrapperr_search_function(); @@ -474,4 +480,4 @@ function search_wrapperr_no_auth(){ get_functions(); -} \ No newline at end of file +}