File tree 4 files changed +32
-1
lines changed
4 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## Version 0.1.29
4
+
5
+ ### Fixed
6
+
7
+ - actually working redeem link for wishlist items (#52 )
8
+
3
9
## Version 0.1.28
4
10
5
11
### Added
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ import WishlistItem from './WishlistItem'
9
9
import AddEditWishlistItemModal from './AddEditWishlistItemModal'
10
10
import ConfirmDialog from './ConfirmDialog'
11
11
import { WishlistItemType } from '@/lib/types'
12
+ import { openWindow } from '@/lib/utils'
13
+ import { toast } from '@/hooks/use-toast'
12
14
13
15
export default function WishlistManager ( ) {
14
16
const {
@@ -62,6 +64,19 @@ export default function WishlistManager() {
62
64
setTimeout ( ( ) => {
63
65
setRecentlyRedeemedId ( null )
64
66
} , 3000 )
67
+
68
+ if ( item . link ) {
69
+ setTimeout ( ( ) => {
70
+ const opened = openWindow ( item . link ! )
71
+ if ( ! opened ) {
72
+ toast ( {
73
+ title : "Popup Blocked" ,
74
+ description : "Please allow popups to open the link" ,
75
+ variant : "destructive"
76
+ } )
77
+ }
78
+ } , 300 )
79
+ }
65
80
}
66
81
}
67
82
Original file line number Diff line number Diff line change @@ -286,4 +286,14 @@ export const playSound = (soundPath: string = '/sounds/timer-end.wav') => {
286
286
audio . play ( ) . catch ( error => {
287
287
console . error ( 'Error playing sound:' , error )
288
288
} )
289
+ }
290
+
291
+ // open a new window (client side only, must be run in browser)
292
+ export const openWindow = ( url : string ) : boolean => {
293
+ const newWindow = window . open ( url , '_blank' )
294
+ if ( newWindow === null ) {
295
+ // Popup was blocked
296
+ return false
297
+ }
298
+ return true
289
299
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " habittrove" ,
3
- "version" : " 0.1.28 " ,
3
+ "version" : " 0.1.29 " ,
4
4
"private" : true ,
5
5
"scripts" : {
6
6
"dev" : " next dev --turbopack" ,
You can’t perform that action at this time.
0 commit comments