mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-12 19:49:59 +05:00
fix(debug): fix debug app requiring reload to show drive
This commit is contained in:
parent
a5df4cc9bc
commit
2c06cffd4a
@ -126,7 +126,7 @@ define([
|
||||
var parsedUnsafeLink;
|
||||
var Handler;
|
||||
|
||||
var currentPad = window.CryptPad_location = {
|
||||
var currentPad = {
|
||||
app: '',
|
||||
href: cfg.href || window.location.href,
|
||||
hash: cfg.hash || window.location.hash
|
||||
@ -401,6 +401,17 @@ define([
|
||||
burnAfterReading = parsed && parsed.hashData && parsed.hashData.ownerKey;
|
||||
|
||||
currentPad.app = parsed.type;
|
||||
|
||||
// Allow "debug" to show drive content if no hash is provided
|
||||
if (parsed.type === "debug" && !currentPad.hash) {
|
||||
currentPad.app = "debug";
|
||||
const fsHash = localStorage.FS_hash;
|
||||
currentPad.hash = Cryptpad.userHash || fsHash;
|
||||
currentPad.href = '/debug/#'+currentPad.hash;
|
||||
window.location.hash = currentPad.hash;
|
||||
parsed = Utils.Hash.parsePadUrl(currentPad.href);
|
||||
}
|
||||
|
||||
if (cfg.getSecrets) {
|
||||
var w = waitFor();
|
||||
// No password for drive, profile and todo
|
||||
|
||||
@ -37,21 +37,15 @@ define([
|
||||
SFCommonO.initIframe(waitFor);
|
||||
}).nThen(function (/*waitFor*/) {
|
||||
var isDrive = false;
|
||||
var isMyDrive = false;
|
||||
if (!window.location.hash) {
|
||||
isDrive = true;
|
||||
isMyDrive = true;
|
||||
} else {
|
||||
var p = Hash.parsePadUrl('/debug/'+window.location.hash);
|
||||
if (p && p.hashData && p.hashData.app === 'drive') {
|
||||
isDrive = true;
|
||||
}
|
||||
}
|
||||
var addData = function (meta, Cryptpad) {
|
||||
if (isMyDrive) { window.location.hash = Cryptpad.userHash; }
|
||||
window.CryptPad_location.app = "debug";
|
||||
window.CryptPad_location.hash = Cryptpad.userHash;
|
||||
window.CryptPad_location.href = '/debug/#'+Cryptpad.userHash;
|
||||
var addData = function (meta) {
|
||||
meta.debugDrive = isDrive;
|
||||
};
|
||||
SFCommonO.start({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user