-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Improved Notification Setting Controls #2377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -475,6 +475,9 @@ function initSidebar() { | |
$('#spawnpoints-switch').prop('checked', Store.get('showSpawnpoints')) | ||
$('#ranges-switch').prop('checked', Store.get('showRanges')) | ||
$('#notify-perfection-wrapper').toggle(Store.get('showPokemonStats')) | ||
$('#hideunnotified-switch').prop('checked', Store.get('hideNotNotified')) | ||
$('#popups-switch').prop('checked', Store.get('showPopups')) | ||
$('#bounce-switch').prop('checked', Store.get('isBounceDisabled')) | ||
$('#sound-switch').prop('checked', Store.get('playSound')) | ||
$('#pokemoncries').toggle(Store.get('playSound')) | ||
$('#cries-switch').prop('checked', Store.get('playCries')) | ||
|
@@ -1677,17 +1680,17 @@ function processPokemon(item) { | |
|
||
if (!(item['encounter_id'] in mapData.pokemons) && | ||
!isPokeExcluded && !isRarityExcluded && isPokeAlive) { | ||
// Add marker to map and item to dict. | ||
if (!item.hidden) { | ||
// Add marker to map and item to dict. | ||
const isNotifyPkmn = isNotifyPoke(item) | ||
if (!item.hidden && (!Store.get('hideNotNotified') || isNotifyPkmn)) { | ||
const isBounceDisabled = Store.get('isBounceDisabled') | ||
const scaleByRarity = Store.get('scaleByRarity') | ||
const isNotifyPkmn = isNotifyPoke(item) | ||
|
||
if (item.marker) { | ||
updatePokemonMarker(item.marker, map, scaleByRarity, isNotifyPkmn) | ||
} else { | ||
newMarker = setupPokemonMarker(item, map, isBounceDisabled, scaleByRarity, isNotifyPkmn) | ||
customizePokemonMarker(newMarker, item) | ||
customizePokemonMarker(newMarker, item, !Store.get('showPopups')) | ||
item.marker = newMarker | ||
} | ||
|
||
|
@@ -2529,11 +2532,11 @@ $(function () { | |
$switchActiveRaidGymsOnly.on('change', function () { | ||
Store.set('showActiveRaidsOnly', this.checked) | ||
lastgyms = false | ||
|
||
updateMap() | ||
}) | ||
|
||
$switchRaidMinLevel = $('#raid-min-level-only-switch') | ||
|
||
$switchRaidMinLevel.select2({ | ||
placeholder: 'Minimum raid level', | ||
minimumResultsForSearch: Infinity | ||
|
@@ -3019,6 +3022,21 @@ $(function () { | |
} | ||
}) | ||
|
||
$('#bounce-switch').change(function () { | ||
Store.set('isBounceDisabled', this.checked) | ||
location.reload() | ||
}) | ||
|
||
$('#hideunnotified-switch').change(function () { | ||
Store.set('hideNotNotified', this.checked) | ||
location.reload() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the more complex to solve but probably you can also iterate over all pokes and remove/add the bouncing. |
||
}) | ||
|
||
$('#popups-switch').change(function () { | ||
Store.set('showPopups', this.checked) | ||
location.reload() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This reload is not needed, previous notifications will dissapear with time and no new ones will appear. |
||
}) | ||
|
||
$('#cries-switch').change(function () { | ||
Store.set('playCries', this.checked) | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I thought I was doing something wrong but it makes some sense, you need to reload in this cases as it is easier than reprocessing everything but the UX is really weird, no one expects to get a reload just clickin in a switch.
The only solution I can think of is telling the user about the reload (alert) or finding a way to reload the map without reloading the page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably you can check how it is done with the pokemon hide and just apply it to everything that is not in the notify list.