Skip to content

Commit

Permalink
Merge branch 'main' into feature/sync_translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzmatazzz authored Feb 5, 2024
2 parents aeb70c9 + 5994cb3 commit d4a0f55
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/features/quests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ export const selectQuestsWithActive = createSelector([selectQuests, selectTrader
return quests.map(quest => {
return {
...quest,
objectives: quest.objectives.map(obj => {
return {
...obj,
complete: settings.objectivesCompleted?.includes(obj.id) || false,
};
}),
active: (() => {
if (!settings.useTarkovTracker) {
return true;
Expand Down
9 changes: 9 additions & 0 deletions src/features/settings/settingsSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export const fetchTarkovTrackerProgress = createAsyncThunk(
level: 72,
hideout: {},
quests: [],
questsFailed: [],
objectives: [],
};

const response = await fetch(
Expand All @@ -38,6 +40,12 @@ export const fetchTarkovTrackerProgress = createAsyncThunk(
}
return failedTasks;
}, []);
returnData.objectivesCompleted = progressData.taskObjectivesProgress.reduce((completedObjectives, current) => {
if (current.complete) {
completedObjectives.push(current.id);
}
return completedObjectives;
}, []);
returnData.flea = progressData.playerLevel >= 15 ? true : false;

returnData.level = progressData.playerLevel;
Expand Down Expand Up @@ -187,6 +195,7 @@ const settingsSlice = createSlice({
if (action.payload) {
state.completedQuests = action.payload.quests;
state.failedQuests = action.payload.questsFailed;
state.objectivesCompleted = action.payload.objectivesCompleted;
state.hasFlea = action.payload.flea;
state.playerLevel = action.payload.level;

Expand Down
3 changes: 3 additions & 0 deletions src/pages/map/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,9 @@ function Map() {
const questObjectives = L.layerGroup();
for (const quest of quests) {
for (const obj of quest.objectives) {
if (settings.useTarkovTracker && mapSettingsRef.current.showOnlyActiveTasks && obj.complete) {
continue;
}
if (obj.possibleLocations) {
for (const loc of obj.possibleLocations) {
if (loc.map.id !== mapData.id) {
Expand Down

0 comments on commit d4a0f55

Please sign in to comment.