From bdee30593633492329ddf1586ba98d4559bf0b47 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Wed, 1 Jan 2020 11:05:44 -0500 Subject: [PATCH] fix unintentional inactivation of local storage settings --- assets/js/settings.js | 2 +- lib/philomena/galleries.ex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/settings.js b/assets/js/settings.js index 99fa8719..f3965b29 100644 --- a/assets/js/settings.js +++ b/assets/js/settings.js @@ -17,7 +17,7 @@ export function setupSettings() { localCheckboxes.forEach(checkbox => { checkbox.checked = Boolean(store.get(checkbox.id)); checkbox.addEventListener('change', () => { - store.set(checkbox.id, checkbox.checked); + store.set(checkbox.id.replace('user_', ''), checkbox.checked); }); }); diff --git a/lib/philomena/galleries.ex b/lib/philomena/galleries.ex index 7011af4a..395e8e4f 100644 --- a/lib/philomena/galleries.ex +++ b/lib/philomena/galleries.ex @@ -266,7 +266,7 @@ defmodule Philomena.Galleries do Repo.insert_all( Interaction, changes, - on_conflict: {:replace_all_except, [:id]}, + on_conflict: {:replace, [:position]}, conflict_target: [:id] )