Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:crystal-garage/kemal-flash into …
Browse files Browse the repository at this point in the history
…develop
  • Loading branch information
mamantoha committed Jan 14, 2025
2 parents 9e55379 + 5c6e2b7 commit e7805a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
6 changes: 4 additions & 2 deletions shard.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name: kemal-flash
version: 0.2.0
version: 0.2.1

crystal: ">= 0.36.0"
crystal: ">= 1.0.0"

dependencies:
kemal:
github: kemalcr/kemal
branch: master
kemal-session:
github: kemalcr/kemal-session
version: ">= 1.0.0"

development_dependencies:
spec-kemal:
Expand Down
15 changes: 6 additions & 9 deletions src/kemal-flash/ext/context.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@ class HTTP::Server::Context
property! flash : Kemal::Flash::FlashHash

def flash : Kemal::Flash::FlashHash
unless @flash
@flash ||= begin
objs = session.objects

@flash =
if objs && objs.keys.includes?("flash")
session.object("flash").as(Kemal::Flash::FlashHash)
else
Kemal::Flash::FlashHash.new
end
if objs && objs.keys.includes?("flash")
session.object("flash").as(Kemal::Flash::FlashHash)
else
Kemal::Flash::FlashHash.new
end
end

@flash.not_nil!
end

# :nodoc:
Expand Down
2 changes: 1 addition & 1 deletion src/kemal-flash/version.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Kemal::Flash
VERSION = "0.2.0"
VERSION = "0.2.1"
end

0 comments on commit e7805a7

Please sign in to comment.