Fix app_version check

This commit is contained in:
Eugene Burmakin 2024-04-21 17:52:09 +02:00
parent efb4ecf19b
commit b64301696e
4 changed files with 7 additions and 3 deletions

View file

@ -1 +1 @@
0.1.7.4
0.1.8

View file

@ -62,4 +62,8 @@ module ApplicationHelper
CheckAppVersion.new.call
end
end
def app_version
File.read('.app_version').strip
end
end

View file

@ -8,6 +8,6 @@ class CheckAppVersion
def call
latest_version = JSON.parse(Net::HTTP.get(URI.parse(@repo_url)))[0]['name']
latest_version == @app_version
latest_version != @app_version
end
end

View file

@ -13,7 +13,7 @@
<%= link_to 'DaWarIch', root_path, class: 'btn btn-ghost normal-case text-xl'%>
<div class="badge mx-4 <%= 'badge-outline' if new_version_available? %> ">
<a href="https://github.com/Freika/dawarich/releases/latest" target="_blank">
0.1.7.3
<%= app_version %>
<% if new_version_available? %>
<span class="tooltip tooltip-bottom" data-tip="Check out Github releases!">
&nbspNew version available