repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
34f80a7
parent
8547f54
author
Eric Bower
date
2024-03-23 21:29:43 +0000 UTC
fix
1 files changed,  +4, -5
M db/postgres/storage.go
+4, -5
 1@@ -1613,12 +1613,11 @@ func (me *PsqlDB) FindTokensForUser(userID string) ([]*db.Token, error) {
 2 
 3 func (me *PsqlDB) createFeatureExpiresAt(userID, name string) time.Time {
 4 	ff, _ := me.FindFeatureForUser(userID, name)
 5-	t := time.Now()
 6-	extendDate := t.AddDate(1, 0, 0)
 7-	if ff != nil {
 8-		extendDate = ff.ExpiresAt.AddDate(1, 0, 0)
 9+	if ff == nil {
10+		t := time.Now()
11+		return t.AddDate(1, 0, 0)
12 	}
13-	return extendDate
14+	return ff.ExpiresAt.AddDate(1, 0, 0)
15 }
16 
17 func (me *PsqlDB) AddPicoPlusUser(username, paymentType, txId string) error {