i have checked your caps
its too confusing
you want to save bar height, right ?
way is simple you have to put bar height to local storage "Key"
and save every time when bar height changes
do --
if exit get it
if get it - do something
if missing - set it
or try to make a simple file or do practice to save data on local storage