mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-02 19:10:16 +01:00
fix tab index counter. In case of a server restart the global var does not exist anymore causing an error
This commit is contained in:
parent
63f389158b
commit
c5c4c65f3c
1 changed files with 3 additions and 0 deletions
|
|
@ -417,6 +417,9 @@ module TodosHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def next_tab_index
|
def next_tab_index
|
||||||
|
# make sure it exists if reset was not called. Set to 20 to avoid clashes with existing form in sidebar
|
||||||
|
$tracks_tab_index ||= 20
|
||||||
|
|
||||||
$tracks_tab_index = $tracks_tab_index + 1
|
$tracks_tab_index = $tracks_tab_index + 1
|
||||||
return $tracks_tab_index
|
return $tracks_tab_index
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue