Update trigger on exception update button pressed

This commit is contained in:
Kelvin 2024-05-16 22:27:53 +02:00
parent d44df42727
commit 88d687f26e
3 changed files with 11 additions and 2 deletions

View file

@ -300,7 +300,7 @@ class UIDialogs {
if(ex is PluginException) ex.code else null,
1,
UIDialogs.Action(context.getString(R.string.update), {
mainFragment.navigate<SourceDetailFragment>(pluginConfig);
mainFragment.navigate<SourceDetailFragment>(SourceDetailFragment.UpdatePluginAction(pluginConfig));
if(mainFragment is VideoDetailFragment)
mainFragment.minimizeVideoDetail();
}, UIDialogs.ActionStyle.ACCENT),

View file

@ -57,8 +57,8 @@ import com.futo.platformplayer.states.StatePlatform
import com.futo.platformplayer.states.StatePlugins
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import java.lang.Exception
import java.time.OffsetDateTime
import kotlin.Exception
import kotlin.reflect.full.findAnnotations
import kotlin.reflect.jvm.kotlinFunction
import kotlin.streams.asSequence

View file

@ -101,6 +101,11 @@ class SourceDetailFragment : MainFragment() {
loadConfig(parameter);
updateSourceViews();
}
else if(parameter is UpdatePluginAction) {
loadConfig(parameter.config);
updateSourceViews();
checkForUpdatesSource();
}
setLoading(false);
}
@ -567,4 +572,8 @@ class SourceDetailFragment : MainFragment() {
const val TAG = "SourceDetailFragment";
fun newInstance() = SourceDetailFragment().apply {}
}
class UpdatePluginAction(val config: SourcePluginConfig) {
}
}