From 6ab5182d92bd4d7897933d3952b9be23794e2cb5 Mon Sep 17 00:00:00 2001
From: andreykproductengine <andreykproductengine@lindenlab.com>
Date: Mon, 15 Apr 2019 17:57:57 +0300
Subject: [PATCH] =?UTF-8?q?SL-10953=20Fixed=20=E2=80=9CNo=20contents?=
 =?UTF-8?q?=E2=80=9D=20is=20displayed=20when=20adding=20a=20large=20number?=
 =?UTF-8?q?=20of=20items=20a=20few=20times?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 indra/newview/llpanelobjectinventory.cpp | 11 +++++++++--
 indra/newview/llpanelobjectinventory.h   |  6 +++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index cd1875e9958..5aa80651c42 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -1498,7 +1498,14 @@ void LLPanelObjectInventory::updateInventory()
 			mIsInventoryEmpty = TRUE;
 		}
 
-		mHaveInventory = TRUE;
+		mHaveInventory = !mIsInventoryEmpty || !objectp->isInventoryDirty();
+		if (objectp->isInventoryDirty())
+		{
+			// Inventory is dirty, yet we received inventoryChanged() callback.
+			// User changed something during ongoing request.
+			// Rerequest. It will clear dirty flag and won't create dupplicate requests.
+			objectp->requestInventory();
+		}
 	}
 	else
 	{
@@ -1768,7 +1775,7 @@ void LLPanelObjectInventory::deleteAllChildren()
 
 BOOL LLPanelObjectInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg)
 {
-	if (mFolders && mHaveInventory)
+	if (mFolders)
 	{
 		LLFolderViewItem* folderp = mFolders->getNextFromChild(NULL);
 		if (!folderp)
diff --git a/indra/newview/llpanelobjectinventory.h b/indra/newview/llpanelobjectinventory.h
index d700c8f4cfb..7b9ecfb8f31 100644
--- a/indra/newview/llpanelobjectinventory.h
+++ b/indra/newview/llpanelobjectinventory.h
@@ -106,9 +106,9 @@ class LLPanelObjectInventory : public LLPanel, public LLVOInventoryListener
 	
 	LLUUID mTaskUUID;
 	LLUUID mAttachmentUUID;
-	BOOL mHaveInventory;
-	BOOL mIsInventoryEmpty;
-	BOOL mInventoryNeedsUpdate;
+	BOOL mHaveInventory; // 'Loading' label and used for initial request
+	BOOL mIsInventoryEmpty; // 'Empty' label
+	BOOL mInventoryNeedsUpdate; // for idle, set on changed callback
 	LLFolderViewModelInventory	mInventoryViewModel;	
 };
 
-- 
GitLab