fix(LinkPreviews): Fix link preview settings
Removing link preview settings leftovers after integration.
This commit is contained in:
parent
b1a8fd6260
commit
c22dc23ce0
|
@ -238,14 +238,10 @@ proc loadLinkPreviews*(self: Controller, urls: seq[string]) =
|
|||
self.messageService.asyncUnfurlUrls(urls)
|
||||
|
||||
proc setLinkPreviewEnabled*(self: Controller, enabled: bool) =
|
||||
if enabled and self.settingsService.saveUrlUnfurlingMode(UrlUnfurlingMode.Enabled):
|
||||
self.linkPreviewPersistentSetting = UrlUnfurlingMode.Enabled
|
||||
self.linkPreviewCurrentMessageSetting = UrlUnfurlingMode.Enabled
|
||||
elif not enabled and self.settingsService.saveUrlUnfurlingMode(UrlUnfurlingMode.Disabled):
|
||||
self.linkPreviewPersistentSetting = UrlUnfurlingMode.Disabled
|
||||
self.linkPreviewCurrentMessageSetting = UrlUnfurlingMode.Disabled
|
||||
|
||||
self.delegate.setAskToEnableLinkPreview(false)
|
||||
if enabled:
|
||||
discard self.settingsService.saveUrlUnfurlingMode(UrlUnfurlingMode.Enabled)
|
||||
return
|
||||
discard self.settingsService.saveUrlUnfurlingMode(UrlUnfurlingMode.Disabled)
|
||||
|
||||
proc onUnfurlingModeChanged(self: Controller, value: UrlUnfurlingMode) =
|
||||
self.linkPreviewPersistentSetting = value
|
||||
|
|
|
@ -248,13 +248,9 @@ QtObject:
|
|||
|
||||
proc enableLinkPreview(self: View) {.slot.} =
|
||||
self.delegate.setLinkPreviewEnabled(true)
|
||||
let links = self.linkPreviewModel.getLinks()
|
||||
self.linkPreviewModel.clearItems()
|
||||
self.loadLinkPreviews(links)
|
||||
|
||||
proc disableLinkPreview(self: View) {.slot.} =
|
||||
self.delegate.setLinkPreviewEnabled(false)
|
||||
self.linkPreviewModel.removeAllPreviewData()
|
||||
|
||||
proc setLinkPreviewEnabledForCurrentMessage(self: View, enabled: bool) {.slot.} =
|
||||
self.delegate.setLinkPreviewEnabledForThisMessage(enabled)
|
||||
|
|
Loading…
Reference in New Issue