mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-01 11:33:41 +03:00
publish: safety check in metadata reducer
This commit is contained in:
parent
8166115751
commit
d46b271ba2
@ -18,7 +18,7 @@ export class MetadataReducer {
|
||||
Object.keys(data).map((channel) => {
|
||||
let channelObj = data[channel];
|
||||
let app = data[channel]["app-name"];
|
||||
if (!metadata[app]) {
|
||||
if (!(app in metadata)) {
|
||||
metadata[app] = {};
|
||||
}
|
||||
metadata[app][channelObj["app-path"]] = channelObj;
|
||||
@ -32,7 +32,7 @@ export class MetadataReducer {
|
||||
if (data) {
|
||||
let metadata = state.associations;
|
||||
let app = data["app-name"];
|
||||
if (!metadata[app]) {
|
||||
if (!(app in metadata)) {
|
||||
metadata[app] = {};
|
||||
}
|
||||
metadata[app][data["app-path"]] = data;
|
||||
@ -55,7 +55,7 @@ export class MetadataReducer {
|
||||
if (data) {
|
||||
let metadata = state.associations;
|
||||
let app = data["app-name"];
|
||||
if (!metadata[app]) {
|
||||
if (!(app in metadata)) {
|
||||
return false;
|
||||
}
|
||||
delete metadata[app][data["app-path"]];
|
||||
|
Loading…
Reference in New Issue
Block a user