Skip to content

Commit

Permalink
Merge pull request #252 from FleekHQ/hotfix/sentfiles/show-local-icon
Browse files Browse the repository at this point in the history
Hotfix: set locally available based on isSentFiles
  • Loading branch information
jsonsivar authored Nov 11, 2020
2 parents 697ca55 + 4371d52 commit f14649c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/textile/sharing.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func (tc *textileClient) GetReceivedFiles(
if file.IsPublicLinkReceived() {
res, err = tc.buildPublicLinkSharedDirEntry(ctx, file)
} else {
res, err = tc.buildInvitationSharedDirEntry(ctx, file)
res, err = tc.buildInvitationSharedDirEntry(ctx, file, false)
}

if err != nil {
Expand Down Expand Up @@ -224,7 +224,7 @@ func (tc *textileClient) GetSentFiles(

var res *domain.SharedDirEntry
for _, file := range files {
res, err = tc.buildInvitationSharedDirEntry(ctx, file.ReceivedFileSchema())
res, err = tc.buildInvitationSharedDirEntry(ctx, file.ReceivedFileSchema(), true)

if err != nil {
return nil, "", err
Expand All @@ -247,7 +247,6 @@ func (tc *textileClient) buildPublicLinkSharedDirEntry(
LocallyAvailable: false,
BackedUp: true,
BackupInProgress: false,

DirEntry: domain.DirEntry{
Path: file.FileName,
IsDir: false,
Expand All @@ -268,6 +267,7 @@ func (tc *textileClient) buildPublicLinkSharedDirEntry(
func (tc *textileClient) buildInvitationSharedDirEntry(
ctx context.Context,
file *model.ReceivedFileSchema,
isSentFiles bool,
) (*domain.SharedDirEntry, error) {
ctx, _, err := tc.getBucketContext(ctx, file.DbID, file.Bucket, true, file.EncryptionKey)
if err != nil {
Expand Down Expand Up @@ -324,7 +324,7 @@ func (tc *textileClient) buildInvitationSharedDirEntry(
DbID: file.DbID,
FileInfo: domain.FileInfo{
IpfsHash: ipfsHash,
LocallyAvailable: false,
LocallyAvailable: isSentFiles,
BackedUp: true,

// TODO: Reflect correct state when we add local updates syncing to remote
Expand Down

0 comments on commit f14649c

Please sign in to comment.