Skip to content

Commit ce73775

Browse files
author
Tyler King
committed
Merge branch 'optimize-conditions' of git://github.com/lucasmichot/laravel-shopify into lucasmichot-optimize-conditions
2 parents 3ed1a8f + dfe8cea commit ce73775

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

src/Http/Middleware/AuthProxy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function handle(Request $request, Closure $next)
7474
],
7575
Util::getShopifyConfig('api_secret', $shop)
7676
);
77-
if (! Hmac::fromNative($signature)->isSame($signatureLocal) || $shop->isNull()) {
77+
if ($shop->isNull() || ! Hmac::fromNative($signature)->isSame($signatureLocal)) {
7878
// Issue with HMAC or missing shop header
7979
return Response::make('Invalid proxy signature.', HttpResponse::HTTP_UNAUTHORIZED);
8080
}

src/Http/Middleware/Billable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function handle(Request $request, Closure $next)
2626
if (Util::getShopifyConfig('billing_enabled') === true) {
2727
/** @var $shop IShopModel */
2828
$shop = auth()->user();
29-
if (! $shop->isFreemium() && ! $shop->isGrandfathered() && ! $shop->plan) {
29+
if (! $shop->plan && ! $shop->isFreemium() && ! $shop->isGrandfathered()) {
3030
// They're not grandfathered in, and there is no charge or charge was declined... redirect to billing
3131
return Redirect::route(
3232
Util::getShopifyConfig('route_names.billing'),

src/Services/CookieHelper.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,21 @@ public function checkSameSiteNoneCompatible(): bool
6767
$browser = $this->getBrowserDetails();
6868
$platform = $this->getPlatformDetails();
6969

70-
if ($this->agent->is('Chrome') && $browser['major'] >= 67) {
70+
if ($browser['major'] >= 67 && $this->agent->is('Chrome')) {
7171
$compatible = true;
7272
}
7373

74-
if ($this->agent->is('iOS') && $platform['major'] > 12) {
74+
if ($platform['major'] > 12 && $this->agent->is('iOS')) {
7575
$compatible = true;
7676
}
7777

78-
if ($this->agent->is('OS X') && $this->agent->is('Safari') && ! $this->agent->is('iOS') &&
79-
$platform['float'] > 10.14
78+
if ($platform['float'] > 10.14 &&
79+
$this->agent->is('OS X') && $this->agent->is('Safari') && ! $this->agent->is('iOS')
8080
) {
8181
$compatible = true;
8282
}
8383

84-
if ($this->agent->is('UCBrowser') &&
85-
$browser['float'] > 12.13
86-
) {
84+
if ($browser['float'] > 12.13 && $this->agent->is('UCBrowser')) {
8785
$compatible = true;
8886
}
8987

src/resources/views/partials/flash_messages.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
document.addEventListener('DOMContentLoaded', function () {
33
var Toast = actions.Toast;
44
5-
@if (request()->has('notice') || isset($flashNotice))
5+
@if (isset($flashNotice) || request()->has('notice'))
66
var toastNotice = Toast.create(app, {
77
message: "{{ request()->get('notice', $flashNotice ?? null) }}",
88
duration: 3000,
99
});
1010
toastNotice.dispatch(Toast.Action.SHOW);
1111
@endif
1212
13-
@if (request()->has('error') || isset($flashError))
13+
@if (isset($flashError) || request()->has('error'))
1414
var toastNotice = Toast.create(app, {
1515
message: "{{ request()->get('error', $flashError ?? null) }}",
1616
duration: 3000,

0 commit comments

Comments
 (0)