MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / refresh

Method refresh

Tactility/Source/app/apphub/AppHubApp.cpp:124–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 }
123
124 void refresh() {
125 lv_obj_clean(contentWrapper);
126 auto* spinner = lvgl::spinner_create(contentWrapper);
127 lv_obj_align(spinner, LV_ALIGN_CENTER, 0, 0);
128
129 lv_obj_add_flag(refreshButton, LV_OBJ_FLAG_HIDDEN);
130
131 if (service::wifi::getRadioState() != service::wifi::RadioState::ConnectionActive) {
132 showNoInternet();
133 return;
134 }
135
136 if (file::isFile(cachedAppsJsonFile)) {
137 showApps();
138 }
139
140 network::http::download(
141 getAppsJsonUrl(),
142 CERTIFICATE_PATH,
143 cachedAppsJsonFile,
144 [] {
145 auto app = findAppInstance();
146 if (app != nullptr) {
147 app->onRefreshSuccess();
148 }
149 },
150 [](const char* error) {
151 auto app = findAppInstance();
152 if (app != nullptr) {
153 app->onRefreshError(error);
154 }
155 }
156 );
157 }
158
159public:
160

Callers 1

onRefreshPressedMethod · 0.95

Calls 7

spinner_createFunction · 0.85
isFileFunction · 0.85
downloadFunction · 0.85
getAppsJsonUrlFunction · 0.85
onRefreshSuccessMethod · 0.80
onRefreshErrorMethod · 0.80
getRadioStateFunction · 0.50

Tested by

no test coverage detected