From 92ca98f59e3a062f78e29f1d1366169c2960a6bf Mon Sep 17 00:00:00 2001 From: Jay Date: Sat, 9 Apr 2022 19:07:36 +0200 Subject: [PATCH 1/3] Extend roadmap --- README.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ce5d5df7..91a23969 100644 --- a/README.md +++ b/README.md @@ -93,12 +93,15 @@ For more information see: https://fomantic-ui.com/introduction/build-tools.html | PHP | PSR-12 | ## :construction: Roadmap -| Item | Status | -| ------------------------------------------ | ------------------- | -| Changelog | Planned | -| Price field for wishes | Planned | -| Save / bookmark wishlists from other users | Planned | -| Activity feed and friends | Under consideration | -| Combined wishes | Under consideration | -| Folders / Subcategories for wishlists | Under consideration | -| Synchronise Steam wishlist | Under consideration | +| Item | Status | +| --------------------------------------------------- | ------------------- | +| Changelog | Planned | +| Option to show/notify when a wish was fulfilled | Planned | +| Price field for wishes | Planned | +| Save / bookmark wishlists from other users | Planned | +| Activity feed and friends | Under consideration | +| Browser extension to quickly create wishes from url | Under consideration | +| Bulk add wishes via link list | Under consideration | +| Combined wishes | Under consideration | +| Folders / Subcategories for wishlists | Under consideration | +| Synchronise Steam wishlist | Under consideration | From 09fdf1ed18827f49aff72137186742b8be1d6329 Mon Sep 17 00:00:00 2001 From: Jay Date: Sat, 9 Apr 2022 19:31:02 +0200 Subject: [PATCH 2/3] Improve channel redirect A channel redirection now only occurs if the current host is listed in one of the channels. --- src/functions/redirect.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/functions/redirect.php b/src/functions/redirect.php index 13234d15..15be64a0 100644 --- a/src/functions/redirect.php +++ b/src/functions/redirect.php @@ -10,11 +10,27 @@ function redirect(string $target) { global $user; + $isDevEnvironment = defined('ENV_IS_DEV') && true === ENV_IS_DEV; + + /** + * Redirect user based on channel setting + */ + $isHostInChannel = false; + + /** Determine if host is a defined channel */ + foreach (CHANNELS as $channel) { + if ($channel['host'] === $_SERVER['HTTP_HOST']) { + $isHostInChannel = true; + break; + } + } + + /** Determine channel to redirect to */ if ( defined('CHANNELS') && is_array(CHANNELS) && isset($user->channel) - && '127.0.0.1' !== $_SERVER['REMOTE_ADDR'] + && !$isDevEnvironment ) { $host = null; @@ -22,6 +38,7 @@ function redirect(string $target) if ( $channel['branch'] === $user->channel && $channel['host'] !== $_SERVER['HTTP_HOST'] + && $isHostInChannel ) { $host = $channel['host']; break; From 7c55c91590d61313f2cb6e9148d625b215214446 Mon Sep 17 00:00:00 2001 From: Jay Date: Sat, 9 Apr 2022 19:48:13 +0200 Subject: [PATCH 3/3] Restore add wish form after success --- src/assets/js/wishlists.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/assets/js/wishlists.js b/src/assets/js/wishlists.js index fca609b1..035c391a 100644 --- a/src/assets/js/wishlists.js +++ b/src/assets/js/wishlists.js @@ -374,8 +374,8 @@ $(function () { var formData = new URLSearchParams(new FormData(form[0])); fetch('/src/api/wishes.php', { - method: 'POST', - body: formData + method : 'POST', + body : formData }) .then(handleFetchError) .then(handleFetchResponse) @@ -384,8 +384,9 @@ $(function () { wishlistsRefresh(); + form.trigger('reset'); + form.find('.dropdown').dropdown('restore defaults'); modalWishlistWishAdd.modal('hide'); - buttonAdd.removeClass('loading'); }) .catch(handleFetchCatch);