Now all communication happens over sockets
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
declare global {
|
||||
function syscall(id: string, name: string, args: any[]): Promise<any>;
|
||||
function syscall(id: number, name: string, args: any[]): Promise<any>;
|
||||
}
|
||||
|
||||
export async function syscall(name: string, ...args: any[]): Promise<any> {
|
||||
let reqId = "" + Math.floor(Math.random() * 1000000);
|
||||
let reqId = Math.floor(Math.random() * 1000000);
|
||||
// console.log("Syscall", name, reqId);
|
||||
return await self.syscall(reqId, name, args);
|
||||
// return new Promise((resolve, reject) => {
|
||||
|
||||
+1
-4
@@ -25,8 +25,6 @@ export async function deletePage() {
|
||||
await syscall("editor.navigate", "start");
|
||||
console.log("Deleting page from space");
|
||||
await syscall("space.deletePage", pageName);
|
||||
console.log("Reloading page list");
|
||||
await syscall("space.reloadPageList");
|
||||
}
|
||||
|
||||
export async function renamePage() {
|
||||
@@ -50,8 +48,6 @@ export async function renamePage() {
|
||||
await syscall("space.writePage", newName, text);
|
||||
console.log("Deleting page from space");
|
||||
await syscall("space.deletePage", oldName);
|
||||
console.log("Reloading page list");
|
||||
await syscall("space.reloadPageList");
|
||||
console.log("Navigating to new page");
|
||||
await syscall("editor.navigate", newName);
|
||||
|
||||
@@ -63,6 +59,7 @@ export async function renamePage() {
|
||||
for (let pageToUpdate of pageToUpdateSet) {
|
||||
console.log("Now going to update links in", pageToUpdate);
|
||||
let { text } = await syscall("space.readPage", pageToUpdate);
|
||||
console.log("Received text", text);
|
||||
if (!text) {
|
||||
// Page likely does not exist, but at least we can skip it
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user