Skip to content

Commit

Permalink
Fixed snowflake validation
Browse files Browse the repository at this point in the history
Signed-off-by: Felix <github@fbrettnich.de>
  • Loading branch information
fbrettnich committed May 15, 2024
1 parent 9f7a582 commit 7ea77f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/Helpers/Discord.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/
function getTimestamp($snowflake)
{
if (invalidateSnowflake($snowflake)) return null;
return $snowflake / 4194304 + 1420070400000;
}

Expand Down
4 changes: 1 addition & 3 deletions resources/views/snowflake-distance.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class="block border-none rounded pl-12 pr-5 py-3 leading-6 w-full bg-discord-gra
<x-error-message>
{{ $errorMessage }}
</x-error-message>
@elseif($snowflake1 && $snowflake2)
@elseif($snowflake1 && $snowflake2 && $snowflake1 != '-')
<div class="flex flex-col rounded shadow-sm bg-discord-gray-1 overflow-hidden">
<div class="p-5 lg:p-6 grow w-full text-center text-2xl font-bold">
{{-- __('The Snowflakes occured at the same time.') --}}
Expand Down Expand Up @@ -62,8 +62,6 @@ function update(timestamp1, timestamp2)
difference.seconds() + " <small>" + (difference.seconds() === 1 ? "{{ trans_choice('second|seconds', 1) }}" : "{{ trans_choice('second|seconds', 0) }}") + "</small><br>" +
difference.milliseconds() + " <small>" + (difference.milliseconds() === 1 ? "{{ trans_choice('millisecond|milliseconds', 1) }}" : "{{ trans_choice('millisecond|milliseconds', 0) }}") + "</small><br>"
;
document.getElementById('snowflakeOneRelative').innerText = moment.utc(timestamp1).local().fromNow();
document.getElementById('snowflakeTwoRelative').innerText = moment.utc(timestamp2).local().fromNow();
}
</script>
</div>

0 comments on commit 7ea77f8

Please sign in to comment.