Compare commits

...

1 Commits

Author SHA1 Message Date
32ae2087bc fix link button. (#171) 2023-02-26 23:03:48 -08:00
3 changed files with 9 additions and 4 deletions

View File

@ -33,8 +33,10 @@ class LinkIconButton extends StatelessWidget {
Icons.stream, Icons.stream,
), ),
), ),
onPressed: () => onPressed: () => LinkUtil.launch(
LinkUtil.launch('https://news.ycombinator.com/item?id=$storyId'), 'https://news.ycombinator.com/item?id=$storyId',
useHackiForHnLink: false,
),
); );
} }
} }

View File

@ -30,6 +30,7 @@ abstract class LinkUtil {
String link, { String link, {
bool useReader = false, bool useReader = false,
bool offlineReading = false, bool offlineReading = false,
bool useHackiForHnLink = true,
}) { }) {
if (offlineReading) { if (offlineReading) {
locator locator
@ -48,7 +49,7 @@ abstract class LinkUtil {
return; return;
} }
if (link.isStoryLink) { if (useHackiForHnLink && link.isStoryLink) {
_onStoryLinkTapped(link); _onStoryLinkTapped(link);
return; return;
} }
@ -103,6 +104,8 @@ abstract class LinkUtil {
); );
} }
}); });
} else {
launch(link, useHackiForHnLink: false);
} }
} }
} }

View File

@ -1,6 +1,6 @@
name: hacki name: hacki
description: A Hacker News reader. description: A Hacker News reader.
version: 1.2.2+95 version: 1.2.3+96
publish_to: none publish_to: none
environment: environment: