mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-21 15:15:48 +02:00
'View detail' errors now ask user if they want to open the tweet in a browser
This commit is contained in:
parent
83c962a7a4
commit
d5c3ea0862
@ -543,7 +543,7 @@ public bool ProcessBrowserKey(Keys key){
|
||||
return false;
|
||||
}
|
||||
|
||||
public void ShowTweetDetail(string columnKey, string chirpId){
|
||||
public void ShowTweetDetail(string columnKey, string chirpId, string fallbackUrl){
|
||||
Activate();
|
||||
|
||||
using(IFrame frame = browser.GetBrowser().MainFrame){
|
||||
@ -554,7 +554,7 @@ public void ShowTweetDetail(string columnKey, string chirpId){
|
||||
}
|
||||
|
||||
notification.FinishCurrentNotification();
|
||||
browser.ExecuteScriptAsync("window.TDGF_showTweetDetail", columnKey, chirpId);
|
||||
browser.ExecuteScriptAsync("window.TDGF_showTweetDetail", columnKey, chirpId, fallbackUrl);
|
||||
}
|
||||
|
||||
public void OnTweetScreenshotReady(string html, int width, int height){
|
||||
|
@ -197,7 +197,7 @@ protected virtual void UpdateTitle(){
|
||||
}
|
||||
|
||||
public void ShowTweetDetail(){
|
||||
owner.ShowTweetDetail(currentNotification.ColumnKey, currentNotification.ChirpId);
|
||||
owner.ShowTweetDetail(currentNotification.ColumnKey, currentNotification.ChirpId, currentNotification.TweetUrl);
|
||||
}
|
||||
|
||||
public void MoveToVisibleLocation(){
|
||||
|
@ -221,11 +221,14 @@
|
||||
$(document).trigger("uiGridClearSelection");
|
||||
};
|
||||
|
||||
window.TDGF_showTweetDetail = function(columnKey, chirpId){
|
||||
let column = TD.controller.columnManager.get(columnKey);
|
||||
window.TDGF_showTweetDetail = function(columnKey, chirpId, fallbackUrl){
|
||||
let column = TD.controller.columnManager.get(columnKey); // TODO replace columnKey with something that stays after a reload
|
||||
|
||||
if (!column){
|
||||
$TD.alert("error", "The column which contained the tweet no longer exists.");
|
||||
if (confirm("error|The column which contained the tweet no longer exists. Would you like to open the tweet in your browser instead?")){
|
||||
$TD.openBrowser(fallbackUrl);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -238,7 +241,9 @@
|
||||
TD.controller.clients.getPreferredClient().show(chirpId, function(chirp){
|
||||
showTweetDetailInternal(column, chirp);
|
||||
}, function(){
|
||||
$TD.alert("error", "Could not retrieve the requested tweet.");
|
||||
if (confirm("error|Could not retrieve the requested tweet. Would you like to open the tweet in your browser instead?")){
|
||||
$TD.openBrowser(fallbackUrl);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user