Karan Adhikari commited on
Commit
09f6d64
·
unverified ·
1 Parent(s): 1a247cd

Update media_edit.html

Browse files
Backend/fastapi/templates/media_edit.html CHANGED
@@ -985,7 +985,7 @@
985
  const token = getCopylinkToken();
986
 
987
  if (!token) {
988
- showErrorMessage('No API token found. Please copy the link from the Dashboard page.');
989
  return;
990
  }
991
 
@@ -1000,7 +1000,8 @@
1000
  }
1001
 
1002
  function getCopylinkToken() {
1003
- return sessionStorage.getItem('api_token') || localStorage.getItem('api_token') || null;
 
1004
  }
1005
 
1006
 
 
985
  const token = getCopylinkToken();
986
 
987
  if (!token) {
988
+ showErrorMessage('No API token found. Please create an API token on the Dashboard page first.');
989
  return;
990
  }
991
 
 
1000
  }
1001
 
1002
  function getCopylinkToken() {
1003
+ const serverToken = {{ (api_token | tojson) if api_token else 'null' }};
1004
+ return serverToken || sessionStorage.getItem('api_token') || localStorage.getItem('api_token') || null;
1005
  }
1006
 
1007