[feat] realm url sharing
This commit is contained in:
@@ -125,7 +125,19 @@ async function importCharacterProcess(f:{
|
||||
}
|
||||
}
|
||||
|
||||
export async function characterHubImport() {
|
||||
export async function characterURLImport() {
|
||||
const realmPath = (new URLSearchParams(location.search)).get('realm')
|
||||
try {
|
||||
if(realmPath){
|
||||
const url = new URL(location.href);
|
||||
url.searchParams.delete('realm');
|
||||
window.history.pushState(null, '', url.toString());
|
||||
downloadRisuHub(realmPath)
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
const charPath = (new URLSearchParams(location.search)).get('charahub')
|
||||
try {
|
||||
if(charPath){
|
||||
|
||||
@@ -14,7 +14,7 @@ import { loadPlugins } from "../plugins/plugins";
|
||||
import { alertConfirm, alertError } from "../alert";
|
||||
import { checkDriverInit, syncDrive } from "../drive/drive";
|
||||
import { hasher } from "../parser";
|
||||
import { characterHubImport, hubURL } from "../characterCards";
|
||||
import { characterURLImport, hubURL } from "../characterCards";
|
||||
import { cloneDeep } from "lodash";
|
||||
import { defaultJailbreak, defaultMainPrompt, oldJailbreak, oldMainPrompt } from "./defaultPrompts";
|
||||
import { loadRisuAccountData } from "../drive/accounter";
|
||||
@@ -408,7 +408,7 @@ export async function loadData() {
|
||||
}
|
||||
checkOldDomain()
|
||||
if(get(DataBase).didFirstSetup){
|
||||
characterHubImport()
|
||||
characterURLImport()
|
||||
}
|
||||
}
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user