Web: Files: fix "getsharingkeys" working
This commit is contained in:
parent
6ba783e3ef
commit
bf7a5d81df
@ -74,8 +74,30 @@ class PureEditor extends React.Component {
|
||||
user,
|
||||
isEncryption,
|
||||
config.editorConfig.encryptionKeys,
|
||||
(keys) => api.files.setEncryptionKeys(keys),
|
||||
true
|
||||
(keys) => {
|
||||
api.files.setEncryptionKeys(keys);
|
||||
},
|
||||
true,
|
||||
(callback) => {
|
||||
api.files
|
||||
.getEncryptionAccess(fileId)
|
||||
.then((keys) => {
|
||||
var data = {
|
||||
keys,
|
||||
};
|
||||
|
||||
callback(data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
toastr.error(
|
||||
typeof error === "string" ? error : error.message,
|
||||
null,
|
||||
0,
|
||||
true
|
||||
);
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,7 @@
|
||||
import toastr from "../components/Toast/toastr";
|
||||
//import store from "../store/index";
|
||||
import isEmpty from "lodash/isEmpty";
|
||||
import omit from "lodash/omit";
|
||||
|
||||
//const { getEncryptionAccess } = store.auth.actions;
|
||||
|
||||
export const desktopConstants = Object.freeze({
|
||||
domain: window.location.origin,
|
||||
provider: "AppServer",
|
||||
@ -16,7 +13,8 @@ export function regDesktop(
|
||||
isEncryption,
|
||||
keys,
|
||||
setEncryptionKeys,
|
||||
isEditor
|
||||
isEditor,
|
||||
getEncryptionAccess
|
||||
) {
|
||||
const data = {
|
||||
displayName: user.displayName,
|
||||
@ -65,7 +63,8 @@ export function regDesktop(
|
||||
break;
|
||||
}
|
||||
case "getsharingkeys":
|
||||
if (!isEditor) return;
|
||||
if (!isEditor && typeof getEncryptionAccess === "function") return;
|
||||
getEncryptionAccess(callback);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user