From 0567547250d6746167f63f98368061884498ee07 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 15 May 2020 16:22:10 +0200 Subject: [PATCH] Add script to fix fork issues --- www/common/cryptpad-common.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 25b1a320f..1204e3e27 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -80,6 +80,40 @@ define([ }); }; + + common.getTeamsId = function () { + postMessage("GET", { + key: ['teams'], + }, function (obj) { + if (obj.error) { return; } + Object.keys(obj || {}).forEach(function (id) { + console.log(obj[id].metadata.name, ':', id); + }); + }); + + }; + common.fixFork = function (teamId) { + var i = 0; + var send = function () { + if (i >= 110) { + postMessage("SET", { + teamId: teamId, + key: ['fixFork'], + }, function () {}); + return; + } + postMessage("SET", { + teamId: teamId, + key: ['fixFork'], + value: i + }, function () { + i++; + setTimeout(send, 500); + }); + }; + send(); + }; + // RESTRICTED // Settings only common.resetDrive = function (cb) {