Skip to content

Commit

Permalink
Merge pull request #814 from digirati-co-uk/feature/NS-57
Browse files Browse the repository at this point in the history
NS-57 - fixed bug with max contributors
  • Loading branch information
stephenwf authored Feb 13, 2024
2 parents 6701383 + 52bf91e commit 4120461
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed token refreshing
- Fixed activity stream pagination (NS-52)
- Fixed visibility of selectors in document panel
- Fixed bug with max contributors (NS-57)

### Changed
- Add short descriptions for admin Search & Metadata actions + correct site config. page titles (MAD-1466)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,10 @@ export const AutosaveRevision: React.FC = () => {
if (isEmpty) {
return;
}
localforage
.setItem(`autosave-${currentRevision.captureModelId}`, currentRevision)
.then(value => {
console.log('saved!');
})
.catch(err => {
console.log(err);
throw new Error(t('Unable to save your submission'));
});
localforage.setItem(`autosave-${currentRevision.captureModelId}`, currentRevision).catch(err => {
console.log(err);
throw new Error(t('Unable to save your submission'));
});
});

const [getSavedRevision, rev] = useMutation(async () => {
Expand All @@ -62,14 +57,9 @@ export const AutosaveRevision: React.FC = () => {
importRevision({ revisionRequest: rev.data });
selectRevision({ revisionId: rev.data.revision.id });

localforage
.removeItem(`autosave-${currentRevision?.captureModelId}`)
.then(() => {
console.log('Key is cleared!');
})
.catch(err => {
console.log(err);
});
localforage.removeItem(`autosave-${currentRevision?.captureModelId}`).catch(err => {
console.log(err);
});
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function useCanvasUserTasks() {

const maxContributors =
canvasTask?.maxContributors && canvasTask.totalContributors
? canvasTask.maxContributors >= canvasTask.totalContributors
? canvasTask.maxContributors <= canvasTask.totalContributors
: false;

// if max contributors reached check that the current user isnt one of them
Expand Down

0 comments on commit 4120461

Please sign in to comment.