diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/WearFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/WearFragment.kt
index 64a386379e..3d043707e2 100644
--- a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/WearFragment.kt
+++ b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/WearFragment.kt
@@ -68,8 +68,7 @@ class WearFragment : DaggerFragment() {
updateGui()
}
binding.exportCustom.setOnClickListener {
- wearPlugin.savedCustomWatchface?.let { importExportPrefs.exportCustomWatchface(it) }
- ?: apply { rxBus.send(EventMobileToWear(EventData.ActionrequestCustomWatchface(true)))}
+ rxBus.send(EventMobileToWear(EventData.ActionrequestCustomWatchface(true)))
}
}
@@ -79,10 +78,12 @@ class WearFragment : DaggerFragment() {
.toObservable(EventWearUpdateGui::class.java)
.observeOn(aapsSchedulers.main)
.subscribe({
- it.customWatchfaceData?.let { loadCustom(it) }
if (it.exportFile)
ToastUtils.okToast(activity, rh.gs(R.string.wear_new_custom_watchface_exported))
- updateGui()
+ else {
+ it.customWatchfaceData?.let { loadCustom(it) }
+ updateGui()
+ }
}, fabricPrivacy::logException)
if (wearPlugin.savedCustomWatchface == null)
rxBus.send(EventMobileToWear(EventData.ActionrequestCustomWatchface(false)))
diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/WearPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/WearPlugin.kt
index 731290df49..bc7ecf84a6 100644
--- a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/WearPlugin.kt
+++ b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/WearPlugin.kt
@@ -95,7 +95,7 @@ class WearPlugin @Inject constructor(
disposable += rxBus
.toObservable(EventWearUpdateGui::class.java)
.observeOn(aapsSchedulers.main)
- .subscribe({ it.customWatchfaceData?.let { cwf -> savedCustomWatchface = cwf } }, fabricPrivacy::logException)
+ .subscribe({ it.customWatchfaceData?.let { cwf -> if (!it.exportFile) savedCustomWatchface = cwf } }, fabricPrivacy::logException)
}
override fun onStop() {
diff --git a/plugins/main/src/main/res/values/strings.xml b/plugins/main/src/main/res/values/strings.xml
index b674fd073c..69dae93b81 100644
--- a/plugins/main/src/main/res/values/strings.xml
+++ b/plugins/main/src/main/res/values/strings.xml
@@ -365,7 +365,7 @@
Load Watchface
Send Watchface
Export template
- Custom watchface exported
+ Custom watchface template exported
Resend All Data
Open Settings on Wear
diff --git a/wear/src/main/java/info/nightscout/androidaps/comm/DataHandlerWear.kt b/wear/src/main/java/info/nightscout/androidaps/comm/DataHandlerWear.kt
index 50ea1f7c14..6a1c07a3f8 100644
--- a/wear/src/main/java/info/nightscout/androidaps/comm/DataHandlerWear.kt
+++ b/wear/src/main/java/info/nightscout/androidaps/comm/DataHandlerWear.kt
@@ -204,7 +204,7 @@ class DataHandlerWear @Inject constructor(
.toObservable(EventData.ActionrequestCustomWatchface::class.java)
.observeOn(aapsSchedulers.io)
.subscribe { eventData ->
- aapsLogger.debug(LTag.WEAR, "Custom Watchface requested from ${eventData.sourceNodeId}")
+ aapsLogger.debug(LTag.WEAR, "Custom Watchface requested from ${eventData.sourceNodeId} export ${eventData.exportFile}")
persistence.readCustomWatchface(eventData.exportFile)?.let {
rxBus.send(EventWearDataToMobile(EventData.ActionGetCustomWatchface(it, eventData.exportFile)))
}