Skip to content

Commit

Permalink
[fix] Replace deprecated CONST with valid version. (#78)
Browse files Browse the repository at this point in the history
* [fix] Replace deprecated CONST with valid version.

* [fix] const fix part 2
  • Loading branch information
Tillerz authored Aug 2, 2024
1 parent 12ca12c commit 0fd19e1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions module/journal.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default class WorldAnvilBrowser extends Application {

// Check linked entry permissions
article.entry = entries.find(e => e.getFlag("world-anvil", "articleId") === article.id);
article.visibleByPlayers = article.entry?.ownership.default >= CONST.DOCUMENT_PERMISSION_LEVELS.OBSERVER;
article.visibleByPlayers = article.entry?.ownership.default >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER;

// Get the category to which the article belongs
const category = categories.get(article.category?.id) || uncategorized;
Expand Down Expand Up @@ -300,11 +300,11 @@ export default class WorldAnvilBrowser extends Application {
const category = this.categories.get(categoryId);
const articles = category?.articles ?? [];
const updates = articles.filter( a => {
return !a.entry?.ownership.default < CONST.DOCUMENT_PERMISSION_LEVELS.OBSERVER;
return !a.entry?.ownership.default < CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER;
}).map( a => {
return {
_id: a.entry.id,
permission: { default: CONST.DOCUMENT_PERMISSION_LEVELS.OBSERVER }
permission: { default: CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER }
}
});

Expand All @@ -324,11 +324,11 @@ export default class WorldAnvilBrowser extends Application {
const category = this.categories.get(categoryId);
const articles = category?.articles ?? [];
const updates = articles.filter( a => {
return a.entry?.ownership.default >= CONST.DOCUMENT_PERMISSION_LEVELS.OBSERVER;
return a.entry?.ownership.default >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER;
}).map( a => {
return {
_id: a.entry.id,
permission: { default: CONST.DOCUMENT_PERMISSION_LEVELS.NONE }
permission: { default: CONST.DOCUMENT_OWNERSHIP_LEVELS.NONE }
}
});

Expand All @@ -349,7 +349,7 @@ export default class WorldAnvilBrowser extends Application {
if( !entry ) { throw 'Can\'t find journal entry with id : ' + entryId; }

const perms = {
default: CONST.DOCUMENT_PERMISSION_LEVELS.OBSERVER
default: CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER
};

await entry.update({permission: perms}, {diff: false, recursive: false, noHook: true});
Expand All @@ -367,7 +367,7 @@ export default class WorldAnvilBrowser extends Application {
if( !entry ) { throw 'Can\'t find journal entry with id : ' + entryId; }

const perms = {
default: CONST.DOCUMENT_PERMISSION_LEVELS.NONE
default: CONST.DOCUMENT_OWNERSHIP_LEVELS.NONE
};

await entry.update({permission: perms}, {diff: false, recursive: false, noHook: true});
Expand Down

0 comments on commit 0fd19e1

Please sign in to comment.