mirror of
https://github.com/TeamPiped/Piped.git
synced 2026-03-15 04:57:00 +00:00
feat: support for adding custom instances
This commit is contained in:
14
src/main.js
14
src/main.js
@@ -553,6 +553,20 @@ const mixin = {
|
||||
|
||||
return !resp.error;
|
||||
},
|
||||
getCustomInstances() {
|
||||
return JSON.parse(window.localStorage.getItem("customInstances")) ?? [];
|
||||
},
|
||||
addCustomInstance(instance) {
|
||||
let customInstances = this.getCustomInstances();
|
||||
customInstances.push(instance);
|
||||
window.localStorage.setItem("customInstances", JSON.stringify(customInstances));
|
||||
},
|
||||
removeCustomInstance(instanceToDelete) {
|
||||
let customInstances = this.getCustomInstances().filter(
|
||||
instance => instance.api_url != instanceToDelete.api_url,
|
||||
);
|
||||
window.localStorage.setItem("customInstances", JSON.stringify(customInstances));
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
authenticated(_this) {
|
||||
|
||||
Reference in New Issue
Block a user