I am trying to make an avatar editor, and I get the error “PromptSetFavorite can not be called again while currently in progress”
Even though the previous prompt had completed.
local function promptCatalogItem()
local view = editorUi.Editor.ItemView.Window
view.ProductName.Text = itemData.Name
view.ProductImage.Image = "rbxthumb://type=Asset&id="..itemData.Id.."&w=420&h=420"
if readInventory then
local curFav = avatarEditor:GetFavorite(itemData.Id, Enum.AvatarItemType.Asset)
if curFav then
view.Like.Image = isLiked
else
view.Like.Image = isNotLiked
end
view.Like.Activated:Connect(function()
activeSetFavorite = {view.Like, not curFav}
avatarEditor:PromptSetFavorite(itemData.Id, Enum.AvatarItemType.Asset, not curFav)
end)
end
editorUi.Editor.ItemView.Visible = true
end
editorConnections.SetFavoriteCallback = avatarEditor.PromptSetFavoriteCompleted:Connect(function(result)
if result == Enum.AvatarPromptResult.Success then
local newFavBool = activeSetFavorite[2]
if newFavBool then
activeSetFavorite[1].Image = isLiked
else
activeSetFavorite[1].Image = isNotLiked
end
activeSetFavorite = nil
end
end)