Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Commit

Permalink
fix missing store init in ext
Browse files Browse the repository at this point in the history
  • Loading branch information
sballesteros committed Feb 3, 2020
1 parent aee1145 commit 243f6c1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
10 changes: 6 additions & 4 deletions src/components/shell-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,9 @@ export default function ShellContent({
disabled={postProgress.isActive}
error={
postProgress.body &&
postProgress.body['@type'] === 'RequestForRapidPREreviewAction' &&
postProgress.error
postProgress.body['@type'] === 'RequestForRapidPREreviewAction'
? postProgress.error
: undefined
}
/>
) : tab === 'review' ? (
Expand Down Expand Up @@ -312,8 +313,9 @@ export default function ShellContent({
disabled={postProgress.isActive}
error={
postProgress.body &&
postProgress.body['@type'] === 'RapidPREreviewAction' &&
postProgress.error
postProgress.body['@type'] === 'RapidPREreviewAction'
? postProgress.error
: undefined
}
/>
) : tab === 'review#success' ? (
Expand Down
19 changes: 9 additions & 10 deletions src/stores/preprint-stores.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,15 @@ export class PreprintsWithActionsStore extends EventEmitter {
action['@type'] === 'RequestForRapidPREreviewAction') &&
getId(action.object)
) {
const preprint = this.peek(createPreprintId(action.object));

if (preprint) {
const nextPreprint = Object.assign({}, preprint, {
potentialAction: arrayify(preprint.potentialAction)
.filter(_action => getId(_action) !== getId(action))
.concat(action)
});
this.set(nextPreprint);
}
const preprint =
this.peek(createPreprintId(action.object)) || action.object;

const nextPreprint = Object.assign({}, preprint, {
potentialAction: arrayify(preprint.potentialAction)
.filter(_action => getId(_action) !== getId(action))
.concat(action)
});
this.set(nextPreprint);
}
}
}
Expand Down

0 comments on commit 243f6c1

Please sign in to comment.