frontend: replace more superagent with pankow fetcher
This commit is contained in:
@@ -5,10 +5,10 @@ import './style.css';
|
||||
|
||||
import '@fontsource/noto-sans';
|
||||
|
||||
import superagent from 'superagent';
|
||||
|
||||
import { createRouter, createWebHashHistory } from 'vue-router';
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
import FileManager from './FileManager.vue';
|
||||
import Home from './views/Home.vue';
|
||||
import Viewer from './views/Viewer.vue';
|
||||
@@ -47,10 +47,8 @@ const i18n = createI18n({
|
||||
|
||||
async function loadLanguage(lang) {
|
||||
try {
|
||||
const result = await superagent.get(`${API_ORIGIN}/translation/${lang}.json`);
|
||||
|
||||
// we do not deliver as application/json :/
|
||||
translations[lang] = JSON.parse(result.text);
|
||||
const result = await fetcher.get(`${API_ORIGIN}/translation/${lang}.json`);
|
||||
translations[lang] = result.body;
|
||||
} catch (e) {
|
||||
console.error(`Failed to load language file for ${lang}`, e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user