mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2025-12-06 16:42:59 +00:00
🐛 minor bugs
- use empty credentials when none given - fix FontAwesomeIcon
This commit is contained in:
parent
029b361e2d
commit
9079fca30f
3 changed files with 18 additions and 21 deletions
|
|
@ -33,20 +33,23 @@ export class API {
|
|||
baseURL: this.api_baseurl,
|
||||
});
|
||||
|
||||
private static readonly storage_key = "advent22/credentials";
|
||||
private static readonly creds_key = "advent22/credentials";
|
||||
|
||||
public static set creds(value: AxiosBasicCredentials | null) {
|
||||
if (value === null) {
|
||||
localStorage.removeItem(this.storage_key);
|
||||
return;
|
||||
localStorage.removeItem(this.creds_key);
|
||||
} else {
|
||||
localStorage.setItem(this.creds_key, JSON.stringify(value));
|
||||
}
|
||||
}
|
||||
|
||||
localStorage.setItem(this.storage_key, JSON.stringify(value));
|
||||
public static get creds(): AxiosBasicCredentials {
|
||||
const auth_json = localStorage.getItem(this.creds_key);
|
||||
if (auth_json !== null) {
|
||||
return JSON.parse(auth_json);
|
||||
} else {
|
||||
return { username: "", password: "" };
|
||||
}
|
||||
|
||||
public static get creds(): AxiosBasicCredentials | undefined {
|
||||
const auth_json = localStorage.getItem(this.storage_key);
|
||||
if (auth_json !== null) return JSON.parse(auth_json);
|
||||
}
|
||||
|
||||
private static get_axios_config({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { App, Plugin } from "vue";
|
||||
/* import font awesome icon component */
|
||||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
||||
|
||||
/* import the fontawesome core */
|
||||
import { library } from "@fortawesome/fontawesome-svg-core";
|
||||
|
|
@ -10,11 +11,4 @@ import { fas } from "@fortawesome/free-solid-svg-icons";
|
|||
/* add icons to the library */
|
||||
library.add(fas);
|
||||
|
||||
/* import font awesome icon component */
|
||||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
||||
|
||||
export const FontAwesomePlugin: Plugin = {
|
||||
install(app: App) {
|
||||
app.component("font-awesome-icon", FontAwesomeIcon);
|
||||
},
|
||||
};
|
||||
export default FontAwesomeIcon;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import FontAwesomeIcon from "@/lib/fontawesome";
|
||||
import { advent22Store } from "@/lib/store";
|
||||
import { FontAwesomePlugin } from "@/plugins/fontawesome";
|
||||
import * as bulmaToast from "bulma-toast";
|
||||
import { setDefaults as toast_set_defaults } from "bulma-toast";
|
||||
import { createPinia } from "pinia";
|
||||
import { createApp } from "vue";
|
||||
import App from "./App.vue";
|
||||
|
|
@ -9,14 +9,14 @@ import "@/main.scss";
|
|||
|
||||
const app = createApp(App);
|
||||
|
||||
app.use(FontAwesomePlugin);
|
||||
app.use(createPinia());
|
||||
app.component("FontAwesomeIcon", FontAwesomeIcon);
|
||||
|
||||
advent22Store().init();
|
||||
|
||||
app.mount("#app");
|
||||
|
||||
bulmaToast.setDefaults({
|
||||
toast_set_defaults({
|
||||
duration: 10e3,
|
||||
pauseOnHover: true,
|
||||
dismissible: true,
|
||||
|
|
|
|||
Loading…
Reference in a new issue