-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extra closeCodes handling for Firefox see phoenixframework/phoenix#5735 (comment)
- Loading branch information
Showing
11 changed files
with
104 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Socket } from "phoenix" | ||
|
||
export class CustomSocket extends Socket { | ||
// Adapted from https://github.com/phoenixframework/phoenix/tree/v1.7.14/assets/js/phoenix | ||
onConnClose = function (event) { | ||
let closeCode = event && event.code | ||
if (this.hasLogger()) this.log("transport", "close", event) | ||
|
||
// Extra closeCodes handling for Firefox | ||
// see https://github.com/phoenixframework/phoenix/pull/5735#issuecomment-2167196419 | ||
if (closeCode == 1000 || closeCode == 1001) this.channels.forEach((c) => c.leave()) | ||
|
||
this.triggerChanError() | ||
this.clearHeartbeats() | ||
if (!this.closeWasClean && closeCode !== 1000) { | ||
this.reconnectTimer.scheduleTimeout() | ||
} | ||
this.stateChangeCallbacks.close.forEach(([, callback]) => callback(event)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<div class="min-h-dvh flex flex-col items-center p-4 py-10"> | ||
<div class="min-h-dvh flex flex-col items-center justify-center"> | ||
<.flash_group flash={@flash} /> | ||
|
||
<main class="max-sm:w-full"> | ||
<main> | ||
<%= @inner_content %> | ||
</main> | ||
</div> |
File renamed without changes.
4 changes: 3 additions & 1 deletion
4
...und_web/live/components/buttons.html.heex → ...eb/components/templates/buttons.html.heex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<h2 class="my-4 text-xl font-bold">Colours</h2> | ||
|
||
<div class={[ | ||
"mt-2 grid w-96 grid-flow-col gap-2 text-center text-white", | ||
"[&_>*]:grid [&_>*]:gap-2", | ||
"[&>*>*]:py-2 [&_>*>*]:rounded-md" | ||
]}> | ||
<div> | ||
<span class="bg-brand-green-50">Green 50</span> | ||
<span class="bg-brand-green-100">Green 100</span> | ||
<span class="bg-brand-green-200">Green 200</span> | ||
<span class="bg-brand-green-300">Green 300</span> | ||
<span class="bg-brand-green-400">Green 400</span> | ||
<span class="bg-brand-green-500">Green 500</span> | ||
<span class="bg-brand-green-600">Green 600</span> | ||
<span class="bg-brand-green-700">Green 700</span> | ||
<span class="bg-brand-green-800">Green 800</span> | ||
<span class="bg-brand-green-900">Green 900</span> | ||
</div> | ||
|
||
<div> | ||
<span class="bg-brand-blue-50">Blue 50</span> | ||
<span class="bg-brand-blue-100">Blue 100</span> | ||
<span class="bg-brand-blue-200">Blue 200</span> | ||
<span class="bg-brand-blue-300">Blue 300</span> | ||
<span class="bg-brand-blue-400">Blue 400</span> | ||
<span class="bg-brand-blue-500">Blue 500</span> | ||
<span class="bg-brand-blue-600">Blue 600</span> | ||
<span class="bg-brand-blue-700">Blue 700</span> | ||
<span class="bg-brand-blue-800">Blue 800</span> | ||
<span class="bg-brand-blue-900">Blue 900</span> | ||
</div> | ||
|
||
<div> | ||
<span class="bg-brand-red-50">Red 50</span> | ||
<span class="bg-brand-red-100">Red 100</span> | ||
<span class="bg-brand-red-200">Red 200</span> | ||
<span class="bg-brand-red-300">Red 300</span> | ||
<span class="bg-brand-red-400">Red 400</span> | ||
<span class="bg-brand-red-500">Red 500</span> | ||
<span class="bg-brand-red-600">Red 600</span> | ||
<span class="bg-brand-red-700">Red 700</span> | ||
<span class="bg-brand-red-800">Red 800</span> | ||
<span class="bg-brand-red-900">Red 900</span> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<h1 class="text-2xl font-bold"> | ||
Welcome to the Playground | ||
<h1 class="text-center text-2xl font-bold"> | ||
The Playground | ||
</h1> | ||
|
||
<%!-- <.buttons /> --%> | ||
|
||
<%!-- <.colors /> --%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters