mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 14:03:42 +00:00
place available_templates
call in update_auth_data
to guarantee that user
object exists
This commit is contained in:
parent
a0113788f9
commit
a9801fc10d
@ -432,7 +432,7 @@ window.refresh_user_data = async (auth_token)=>{
|
||||
}
|
||||
}
|
||||
|
||||
window.update_auth_data = (auth_token, user)=>{
|
||||
window.update_auth_data = async (auth_token, user)=>{
|
||||
window.auth_token = auth_token;
|
||||
localStorage.setItem('auth_token', auth_token);
|
||||
|
||||
@ -493,6 +493,9 @@ window.update_auth_data = (auth_token, user)=>{
|
||||
$('.user-options-login-btn, .user-options-create-account-btn').hide();
|
||||
$('.user-options-menu-btn').show();
|
||||
}
|
||||
|
||||
// Search and store user templates
|
||||
window.file_templates = await window.available_templates()
|
||||
}
|
||||
|
||||
window.mutate_user_preferences = function(user_preferences_delta) {
|
||||
@ -838,7 +841,6 @@ window.create_file = async(options)=>{
|
||||
}
|
||||
|
||||
window.available_templates = async () => {
|
||||
console.log(window.user.username)
|
||||
const baseRoute = `/${window.user.username}`
|
||||
const keywords = ["template", "templates", i18n('template')]
|
||||
//make sure all its lowercase
|
||||
|
@ -108,8 +108,6 @@ const launch_services = async function (options) {
|
||||
const svc_process = globalThis.services.get('process');
|
||||
svc_process.get_init().chstatus(PROCESS_RUNNING);
|
||||
}
|
||||
// Search and store user templates
|
||||
window.file_templates = await window.available_templates()
|
||||
};
|
||||
|
||||
// This code snippet addresses the issue flagged by Lighthouse regarding the use of
|
||||
|
Loading…
Reference in New Issue
Block a user